Created
January 11, 2019 14:12
-
-
Save qsun/b737cb06362a9a3d05a6c0ad2caf03ce to your computer and use it in GitHub Desktop.
mimic poll with IRQ (using C macro)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IT_WRAP(uart6_dma_in_progress, HAL_UART_Transmit_IT(&CLI_UART, (uint8_t *)(debug_log_str + debug_log_tail), len)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define IT_WRAP(v, ...) do { \ | |
v = 1; \ | |
do { \ | |
__VA_ARGS__; \ | |
} while (0); \ | |
while (v == 1) { \ | |
osDelay(0); \ | |
} \ | |
} while(0); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment