Skip to content

Commit

Permalink
Implement our_delay_cycles for MSP430-GCC
Browse files Browse the repository at this point in the history
  • Loading branch information
Chih-Hsuan Yen committed Sep 4, 2021
1 parent 46b39b5 commit 37b7d7b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ext_fram
Submodule ext_fram updated 1 files
+2 −2 extfram.c
10 changes: 10 additions & 0 deletions our_misc.h
Expand Up @@ -17,7 +17,17 @@ inline void our_delay_cycles_internal(uint32_t n_cycles) {
: [n_cycles] "r"(n_cycles));
}
#elif defined(__MSP430__)
# ifdef __GNUC__
inline void our_delay_cycles_internal(uint32_t n_cycles) {
__asm__ volatile(".Lour_delay_cycles_loop%=:\n"
"DEC %[n_cycles]\n"
"JNE .Lour_delay_cycles_loop%=\n"
:
: [n_cycles] "r"(n_cycles));
}
# else
void our_delay_cycles_internal(uint16_t n_cycles);
#endif
#elif defined(__linux__)
#define our_delay_cycles_internal(n_cycles)
#endif
Expand Down

0 comments on commit 37b7d7b

Please sign in to comment.