fixed AFHDS3 taranis external module

This commit is contained in:
Raphael Coeffic
2020-12-09 07:24:28 +01:00
parent 87b63402fd
commit 1c33efac9f
2 changed files with 8 additions and 13 deletions
+1 -12
View File
@@ -94,9 +94,6 @@ struct Data
void reset()
{
#if !(defined(EXTMODULE_USART) && defined(EXTMODULE_TX_INVERT_GPIO))
total = 0;
#endif
pulsesSize = 0;
}
#if defined(EXTMODULE_USART) && defined(EXTMODULE_TX_INVERT_GPIO)
@@ -118,7 +115,6 @@ struct Data
return;
}
pulses[pulsesSize++] = v;
total += v;
}
void sendByte(uint8_t b)
{
@@ -149,14 +145,7 @@ struct Data
//add remaining time of frame
void flush()
{
uint16_t diff = AFHDS3_FRAME_HALF_US - total;
pulses[pulsesSize - 1] += diff;
//ensure 2 ms break
if (pulses[pulsesSize - 1] < 4000)
{
pulses[pulsesSize - 1] = 4050;
}
total += diff;
pulses[pulsesSize - 1] = 60000;
}
const uint16_t* getData()