remove idle rate enforcement, should be done in application level

This commit is contained in:
hathach
2019-03-23 17:15:00 +07:00
parent df1aac44b8
commit d866999bf0
2 changed files with 19 additions and 47 deletions

View File

@@ -121,10 +121,11 @@ void tud_cdc_rx_cb(uint8_t itf)
void usb_hid_task(void)
{
// Poll every 10ms
static tu_timeout_t tm = { .start = 0, .interval = 10 };
const uint32_t interval_ms = 10;
static uint32_t start_ms = 0;
if ( !tu_timeout_expired(&tm) ) return; // not enough time
tu_timeout_reset(&tm);
if ( board_noos_millis() < start_ms + interval_ms) return; // not enough time
start_ms += interval_ms;
uint32_t const btn = board_buttons();
@@ -193,12 +194,14 @@ void tud_umount_cb(void)
//--------------------------------------------------------------------+
void led_blinking_task(void)
{
const uint32_t interval_ms = 1000;
static uint32_t start_ms = 0;
static bool led_state = false;
// Blink every 1000 ms
if ( board_noos_millis() < start_ms + 1000) return; // not enough time
start_ms += 1000;
if ( board_noos_millis() < start_ms + interval_ms) return; // not enough time
start_ms += interval_ms;
board_led_control(led_state);
led_state = 1 - led_state; // toggle