1.1 --- a/c++/rgb-assembler/rgb-assembler.cpp Sun Dec 24 00:12:58 2017 +0100
1.2 +++ b/c++/rgb-assembler/rgb-assembler.cpp Sun Dec 24 00:17:12 2017 +0100
1.3 @@ -8,6 +8,7 @@
1.4 #include "types.h"
1.5 #include "memory.h"
1.6 #include "Command.h"
1.7 +#include "commands.h"
1.8 #include "commands/Goto.h"
1.9 #include "commands/GotoCompare.h"
1.10 #include "commands/Sleep.h"
1.11 @@ -17,64 +18,6 @@
1.12
1.13 using namespace std;
1.14
1.15 -// TODO: strong typedefs http://www.boost.org/doc/libs/1_61_0/libs/serialization/doc/strong_typedef.html ?
1.16 -
1.17 -/**
1.18 - * Skip to the given address.
1.19 - * parameter: address_t
1.20 - */
1.21 -const command_t CMD_GOTO = 0x70;
1.22 -
1.23 -/**
1.24 - * Compare values on two addresses and go to one of given three addresses.
1.25 - * parameter: address_t a
1.26 - * parameter: address_t b
1.27 - * parameter: address_t GOTO target when a == b
1.28 - * parameter: address_t GOTO target when a > b
1.29 - * parameter: address_t GOTO target when a < b
1.30 - */
1.31 -const command_t CMD_GOTO_COMPARE = 0x80;
1.32 -
1.33 -/**
1.34 - * Wait given time in ms.
1.35 - * parameter: sleep_t
1.36 - */
1.37 -const command_t CMD_SLEEP = 0xFF;
1.38 -
1.39 -/**
1.40 - * Set RGB LED color.
1.41 - * parameter: led_t LED number
1.42 - * parameter: color_t red
1.43 - * parameter: color_t green
1.44 - * parameter: color_t blue
1.45 - */
1.46 -const command_t CMD_COLOR = 0xAA;
1.47 -
1.48 -/**
1.49 - * Stop program.
1.50 - */
1.51 -const command_t CMD_END = 0xED;
1.52 -
1.53 -/**
1.54 - * Increase value at given address
1.55 - * parameter: address_t
1.56 - */
1.57 -const command_t CMD_INCREMENT = 0x11;
1.58 -
1.59 -/**
1.60 - * Decrease value at given address
1.61 - * parameter: address_t
1.62 - */
1.63 -const command_t CMD_DECREMENT = 0x12;
1.64 -
1.65 -/**
1.66 - * Placeholder for unsupported command.
1.67 - * Just for testing.
1.68 - */
1.69 -const command_t CMD_INVALID = 0x1;
1.70 -
1.71 -// TODO: more commands, better numbers
1.72 -
1.73 int main(int argc, char* argv[]) {
1.74
1.75 setlocale(LC_ALL, "");