mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-19 19:21:05 +00:00
atomic GPIO operation in BSP
This commit is contained in:
parent
7d8ecc63a6
commit
6ab799c7eb
@ -93,8 +93,11 @@ void board_led_write(bool state)
|
||||
{
|
||||
uint32_t current = (state) ? LED_STATE_ON : (1-LED_STATE_ON);
|
||||
current <<= LED_PIN;
|
||||
uint32_t irq_state = __get_PRIMASK();
|
||||
__disable_irq();
|
||||
current |= LED_PORT->DOUT & ~(1UL << LED_PIN);
|
||||
LED_PORT->DOUT = current;
|
||||
__set_PRIMASK(irq_state);
|
||||
}
|
||||
|
||||
uint32_t board_button_read(void)
|
||||
|
Loading…
x
Reference in New Issue
Block a user