simple/main.c
// Toggle the internal LED every half second
Toggle the internal LED every half second
Toggle the internal LED every half second
static void blink_led(void)
{
  static uint64_t last_toggle = 0;
  uint64_t cur_time = time_us_64();
  if (last_toggle + 500000 < cur_time) {
    gpio_xor_mask(1<<LED_PIN);
    last_toggle = cur_time;
  }
}
static void blink_led ( void ) { static uint64_t last_toggle = 0 ; uint64_t cur_time = time_us_64 ( ) ; if ( last_toggle + 500000 < cur_time ) { gpio_xor_mask ( 1 << LED_PIN ) ; last_toggle = cur_time ; } }
Toggle the internal LED every half second
Toggle the internal LED every half second