X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fdrivers%2Fao_lco_bits.c;fp=src%2Fdrivers%2Fao_lco_bits.c;h=bc54dc22b8ab9992d4b8b2a0419fc9774a62e228;hp=6e50e44db4f8bec93edf71a42ab72a8f940f64c2;hb=54e98a498db0d7026ce16c3ad53bc60986c68253;hpb=366c1422f6d34c8f616dc95c2767d01c4f53f581 diff --git a/src/drivers/ao_lco_bits.c b/src/drivers/ao_lco_bits.c index 6e50e44d..bc54dc22 100644 --- a/src/drivers/ao_lco_bits.c +++ b/src/drivers/ao_lco_bits.c @@ -33,7 +33,7 @@ uint8_t ao_lco_drag_race; struct ao_pad_query ao_pad_query; /* latest query response */ static uint8_t ao_lco_channels[AO_PAD_MAX_BOXES]; /* pad channels available on each box */ -static uint16_t ao_lco_tick_offset[AO_PAD_MAX_BOXES]; /* offset from local to remote tick count */ +static uint16_t ao_lco_tick_offset[AO_PAD_MAX_BOXES]; /* 16 bit offset from local to remote tick count */ static uint8_t ao_lco_selected[AO_PAD_MAX_BOXES]; /* pads selected to fire */ #define AO_LCO_VALID_LAST 1 @@ -322,7 +322,7 @@ ao_lco_search(void) void ao_lco_monitor(void) { - uint16_t delay; + AO_TICK_TYPE delay; uint8_t box; for (;;) { @@ -358,8 +358,8 @@ ao_lco_monitor(void) uint8_t ao_lco_drag_beep_count; static uint8_t ao_lco_drag_beep_on; -static uint16_t ao_lco_drag_beep_time; -static uint16_t ao_lco_drag_warn_time; +static AO_TICK_TYPE ao_lco_drag_beep_time; +static AO_TICK_TYPE ao_lco_drag_warn_time; #define AO_LCO_DRAG_BEEP_TIME AO_MS_TO_TICKS(50) #define AO_LCO_DRAG_WARN_TIME AO_SEC_TO_TICKS(5) @@ -391,14 +391,14 @@ ao_lco_toggle_drag(void) * turn it on or off as necessary and bump the remaining beep counts */ -uint16_t -ao_lco_drag_beep_check(uint16_t now, uint16_t delay) +AO_TICK_TYPE +ao_lco_drag_beep_check(AO_TICK_TYPE now, AO_TICK_TYPE delay) { PRINTD("beep check count %d delta %d\n", ao_lco_drag_beep_count, - (int16_t) (now - ao_lco_drag_beep_time)); + (AO_TICK_SIGNED) (now - ao_lco_drag_beep_time)); if (ao_lco_drag_beep_count) { - if ((int16_t) (now - ao_lco_drag_beep_time) >= 0) { + if ((AO_TICK_SIGNED) (now - ao_lco_drag_beep_time) >= 0) { if (ao_lco_drag_beep_on) { ao_beep(0); PRINTD("beep stop\n"); @@ -418,7 +418,7 @@ ao_lco_drag_beep_check(uint16_t now, uint16_t delay) } if (ao_lco_drag_beep_count) { - uint16_t beep_delay = 0; + AO_TICK_TYPE beep_delay = 0; if (ao_lco_drag_beep_time > now) beep_delay = ao_lco_drag_beep_time - now; @@ -463,13 +463,13 @@ ao_lco_drag_disable(void) * active */ -uint16_t -ao_lco_drag_warn_check(uint16_t now, uint16_t delay) +AO_TICK_TYPE +ao_lco_drag_warn_check(AO_TICK_TYPE now, AO_TICK_TYPE delay) { if (ao_lco_drag_race) { - uint16_t warn_delay; + AO_TICK_TYPE warn_delay; - if ((int16_t) (now - ao_lco_drag_warn_time) >= 0) { + if ((AO_TICK_SIGNED) (now - ao_lco_drag_warn_time) >= 0) { ao_lco_drag_add_beeps(1); ao_lco_drag_warn_time = now + AO_LCO_DRAG_WARN_TIME; }