Skip to content

Instantly share code, notes, and snippets.

@qsun
Created January 11, 2019 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qsun/b737cb06362a9a3d05a6c0ad2caf03ce to your computer and use it in GitHub Desktop.
Save qsun/b737cb06362a9a3d05a6c0ad2caf03ce to your computer and use it in GitHub Desktop.
mimic poll with IRQ (using C macro)
IT_WRAP(uart6_dma_in_progress, HAL_UART_Transmit_IT(&CLI_UART, (uint8_t *)(debug_log_str + debug_log_tail), len));
#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