From 73b64412a05c02b9c0274a33919d15c8678c8bfb Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Tue, 20 Mar 2018 00:19:42 +0100 Subject: Changing the readme.md to markdown🤦 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 25e68b2..b0baaa7 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,31 @@ -= memConfigger +# memConfigger This is a simple python-script that takes a simple file with variable-names and types, and turns it into a cpp-lookup-function. I wrote it to simplify allocation of space on EEPROMS, meaning i don't have to do any math. I just have to copy-paste the function. This is probably not the best way to to it, but it works just fine. I Might add the CPP-class that i put the resulting function into when i get time to turn it into a skeleton, and make som docs on it. -== Use +## Use You need python installed, i believe 2.7 is what i have on my computer. Altough i don't see why it wouldn't work with Python 3 as well. I think the code is compiant. Start it with -´´´ +``` python memConfigger.py -´´´ -If the input-file exists and have the proper data, it will produce two files. Both with the same name (Except last .\*), ending with ´.out.cpp´ and ´.out.adoc´. +``` +If the input-file exists and have the proper data, it will produce two files. Both with the same name (Except last .\*), ending with `.out.cpp` and `.out.adoc`. -´.cpp´ is the generated function, and ´.adoc´ is a more human-friendly lookup-table. +`.cpp` is the generated function, and `.adoc` is a more human-friendly lookup-table. -== Input-file -This should be a flat-file consisting of commands, one for each line. Lines that are blank, or are starting with a ´#´ is ignored. +## Input-file +This should be a flat-file consisting of commands, one for each line. Lines that are blank, or are starting with a `#` is ignored. -If the line starts with a ´!´, the following should be one of the following: -- ´SIZE ´ This sets the max size of the EEPROM, it doesn't actually affect the execution. If you set it in the top of you file however, it will keep track of the available space on your PROM. ´Defaults to 0´ -- ´INC ´ This will push the integer forward. Making some space on you PROM, this could be usefull if you plan to reserve some space at a spesific location for later updates, that shouldn't affect the current user-data. +If the line starts with a `!`, the following should be one of the following: +- `SIZE ` This sets the max size of the EEPROM, it doesn't actually affect the execution. If you set it in the top of you file however, it will keep track of the available space on your PROM. `Defaults to 0`. +- `INC ` This will push the integer forward. Making some space on you PROM, this could be usefull if you plan to reserve some space at a spesific location for later updates, that shouldn't affect the current user-data. If the line does not start with an exlamation mark, we are assuming the first word is an type. At the moment there are only three possible types. The list below starts with how a line should look, for it to be interpereted correctly: -- ´STR_ASCII ´ This is just that, each byte will be an ascii character. -- ´LONG ´ This is two bytes, usually you would sum them to get their value. -- ´INT ´ This is just one byte. +- `STR_ASCII ` This is just that, each byte will be an ascii character. +- `LONG ` This is two bytes, usually you would sum them to get their value. +- `INT ` This is just one byte. == Example-file -´´´ +``` # We are setting the size, so the parser can notify us if and when we exceed it !SIZE 124 @@ -41,4 +41,4 @@ INT age LONG XP STR_ASCII 20 some_more_info INT Another_int -´´´ +``` -- cgit v1.2.3 From f1d5704097a6c62d8c94d71c3517c12c13ebfa88 Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Tue, 20 Mar 2018 00:20:55 +0100 Subject: Made the last header be markdown-style as well 🤦 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b0baaa7..242b1fd 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ If the line does not start with an exlamation mark, we are assuming the first wo - `LONG ` This is two bytes, usually you would sum them to get their value. - `INT ` This is just one byte. -== Example-file +## Example-file ``` # We are setting the size, so the parser can notify us if and when we exceed it !SIZE 124 -- cgit v1.2.3