we now always listen before transmit - even if we have just completed a packet

This commit is contained in:
geeksville
2020-05-02 08:29:51 -07:00
parent 4735b3ff5b
commit 2ad314f150
6 changed files with 115 additions and 53 deletions

15
src/OSTimer.h Normal file
View File

@@ -0,0 +1,15 @@
#pragma once
#include <Arduino.h>
typedef void (*PendableFunction)(void *pvParameter1, uint32_t ulParameter2);
/**
* Schedule a callback to run. The callback must _not_ block, though it is called from regular thread level (not ISR)
*
* @return true if successful, false if the timer fifo is too full.
*/
inline bool scheduleCallback(PendableFunction callback, void *param1, uint32_t param2, uint32_t delayMsec)
{
return xTimerPendFunctionCall(callback, param1, param2, pdMS_TO_TICKS(delayMsec));
}