X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?p=bike-lights.git;a=blobdiff_plain;f=firmware%2Fcontrol.c;h=a219f19205947b8a11a6b3d3ee9efb1ccad37b94;hp=a90bb713dfa846f9df2775b347180f8a6290d7f4;hb=29b27abe6adedf08f1067a76c8785cd8fe5d3296;hpb=4728997cb5f6eff94c8a9d9e253d1675b7516987 diff --git a/firmware/control.c b/firmware/control.c index a90bb71..a219f19 100644 --- a/firmware/control.c +++ b/firmware/control.c @@ -4,106 +4,103 @@ #include "lights.h" static pattern_t panic_pattern[] = { - { 3, 1 }, // FIXME: will be 4, but let's be safe while testing - { 0, 1 }, - { 3, 1 }, - { 0, 1 }, - { 3, 1 }, - { 0, 1 }, - { 3, 1 }, - { 0, 1 }, - { 3, 1 }, - { 0, 1 }, - { 3, 1 }, - { 0, 1 }, - { 3, 1 }, - { 0, 1 }, - { 3, 1 }, - { 0, 1 }, - { 3, 1 }, - { 0, 1 }, - { 3, 1 }, - { 0, 1 }, - { 3, 1 }, - { 0, 1 }, + { 3, D_1 }, // FIXME: will be 4, but let's be safe while testing + { 0, D_1 }, + { 3, D_1 }, + { 0, D_1 }, + { 3, D_1 }, + { 0, D_1 }, + { 3, D_1 }, + { 0, D_1 }, + { 3, D_1 }, + { 0, D_1 }, + { 3, D_1 }, + { 0, D_1 }, + { 3, D_1 }, + { 0, D_1 }, + { 3, D_1 }, + { 0, D_1 }, + { 3, D_1 }, + { 0, D_1 }, + { 3, D_1 }, + { 0, D_1 }, + { 3, D_1 }, + { 0, D_1 }, PATTERN_END }; pattern_t on1_pattern [] = { - { 1, 0x7 }, + { 1, D_8 }, PATTERN_END }; static pattern_t on2_pattern [] = { - { 2, 0x7 }, + { 2, D_8 }, PATTERN_END }; static pattern_t on3_pattern [] = { - { 3, 0x7 }, + { 3, D_8 }, PATTERN_END }; static pattern_t brake_pattern [] = { - { 4, 0x2 }, - { 3, 0x7 }, + { 4, D_2 }, + { 3, D_8 }, PATTERN_END }; static pattern_t normal2_pattern[] = { - { 2, 0x1 }, - { 0, 0x1 }, - { 2, 0x1 }, - { 0, 0x7 }, - { 1, 0x1 }, - { 0, 0x1 }, - { 1, 0x1 }, - { 0, 0x7 }, + { 2, D_1 }, + { 0, D_1 }, + { 2, D_1 }, + { 0, D_8 }, + { 1, D_1 }, + { 0, D_1 }, + { 1, D_1 }, + { 0, D_8 }, PATTERN_END }; static pattern_t normal3_pattern[] = { - { 3, 0x1 }, - { 0, 0x1 }, - { 3, 0x1 }, - { 0, 0x7 }, - { 1, 0x1 }, - { 0, 0x1 }, - { 1, 0x1 }, - { 0, 0x7 }, + { 3, D_1 }, + { 0, D_1 }, + { 3, D_1 }, + { 0, D_8 }, + { 1, D_1 }, + { 0, D_1 }, + { 1, D_1 }, + { 0, D_8 }, PATTERN_END }; static pattern_t normal4_pattern[] = { - { 4, 0x1 }, - { 0, 0x1 }, - { 4, 0x1 }, - { 0, 0x7 }, - { 1, 0x1 }, - { 0, 0x1 }, - { 1, 0x1 }, - { 0, 0x7 }, + { 4, D_1 }, + { 0, D_1 }, + { 4, D_1 }, + { 0, D_8 }, + { 1, D_1 }, + { 0, D_1 }, + { 1, D_1 }, + { 0, D_8 }, PATTERN_END }; static pattern_t slow1_pattern[] = { - { 1, 0x01 }, - { 0, 0x7 }, - { 0, 0x7 }, + { 1, D_1 }, + { 0, D_13 }, PATTERN_END }; static pattern_t slow2_pattern[] = { - { 2, 0x01 }, - { 0, 0x7 }, - { 0, 0x7 }, + { 2, D_1 }, + { 0, D_13 }, PATTERN_END }; static pattern_t slow3_pattern[] = { - { 3, 0x01 }, - { 0, 0x7 }, - { 0, 0x7 }, + { 3, D_1 }, + { 0, D_13 }, PATTERN_END };