X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Ftelelco-v2.0%2Fao_lco_v2.c;h=78849bc9b43bc00f551a70133aef6fbdcd66327a;hb=fab278542c9bb31991a93604a9f646e8cd8285af;hp=3583be98f9ec23a7586c1d4d00ce46237bd34f27;hpb=c49bd3cb0c31a51fae79ddc92237cc309be9a242;p=fw%2Faltos diff --git a/src/telelco-v2.0/ao_lco_v2.c b/src/telelco-v2.0/ao_lco_v2.c index 3583be98..78849bc9 100644 --- a/src/telelco-v2.0/ao_lco_v2.c +++ b/src/telelco-v2.0/ao_lco_v2.c @@ -33,6 +33,9 @@ /* UI values */ static uint8_t ao_lco_select_mode; +static uint8_t ao_lco_event_debug; + +#define PRINTE(...) do { if (!ao_lco_debug && !ao_lco_event_debug) break; printf ("\r%5lu %s: ", (unsigned long) ao_tick_count, __func__); printf(__VA_ARGS__); flush(); } while(0) #define AO_LCO_SELECT_PAD 0 #define AO_LCO_SELECT_BOX 1 @@ -176,7 +179,7 @@ ao_lco_input(void) for (;;) { ao_event_get(&event); - PRINTD("event type %d unit %d value %ld\n", + PRINTE("event type %d unit %d value %ld\n", event.type, event.unit, (long) event.value); switch (event.type) { case AO_EVENT_QUADRATURE: @@ -283,13 +286,16 @@ static void ao_lco_set_debug(void) { uint32_t r = ao_cmd_decimal(); - if (ao_cmd_status == ao_cmd_success) - ao_lco_debug = r != 0; + if (ao_cmd_status == ao_cmd_success){ + ao_lco_debug = r & 1; + ao_lco_event_debug = (r & 2) >> 1; + } } const struct ao_cmds ao_lco_cmds[] = { { ao_lco_set_debug, "D <0 off, 1 on>\0Debug" }, { ao_lco_search, "s\0Search for pad boxes" }, + { ao_lco_pretend, "p\0Pretend there are lots of pad boxes" }, { 0, NULL } }; #endif