Working baseline, works with -O0 -- -O3 AND -O0 with gcc 4.9.3 Ubuntu. TX to RX switch timing is the challenge. IOArduino.cpp may not work

This commit is contained in:
danilo 2017-03-31 19:14:17 +02:00
parent 3a4451684f
commit aefe492f9b
5 changed files with 102 additions and 69 deletions

View file

@ -124,11 +124,6 @@ void CIO::delay_rx() {
#endif
}
void CIO::dlybit(void)
{
delayMicroseconds(1);
}
void CIO::Init()
{
#if defined (__STM32F1__)
@ -289,4 +284,15 @@ void CIO::COS_pin(bool on)
digitalWrite(PIN_COS_LED, on ? HIGH : LOW);
}
// TODO: Investigate why. In fact there is just a single place where this is being use
// during normal operation
#pragma GCC optimize ("O0")
void CIO::dlybit(void)
{
asm volatile("nop \n\t"
"nop \n\t"
"nop \n\t"
);
}
#endif