All tested compilers & make build now have proper timing for tx switching (gcc 4.9.3, O0, Os, O3, gcc 6.3. O0, O3)

This commit is contained in:
danilo 2017-04-02 03:09:30 +02:00
parent 02ee23b684
commit 70457f269e
6 changed files with 104 additions and 66 deletions

View file

@ -579,16 +579,15 @@ void CIO::delay_rx() {
#endif
}
void CIO::delay_us(uint32_t us) {
::delay_us(us);
}
// TODO: Investigate why. In fact there is just a single place where this is being use
// during normal operation
// it seems that optimizing this code breaks some timings
#pragma GCC optimize ("O0")
static inline void delay_ns() {
asm volatile("mov r8, r8 \n\t"
"mov r8, r8 \n\t"
"mov r8, r8 \n\t"
asm volatile("nop \n\t"
"nop \n\t"
"nop \n\t"
);
}