new threading finished- saves about 10mA for the high activity states

This commit is contained in:
Kevin Hester
2020-10-11 08:12:53 +08:00
parent c44d8a0433
commit 0c8e0efed2
4 changed files with 33 additions and 20 deletions

View File

@@ -20,12 +20,12 @@ InterruptableDelay::~InterruptableDelay()
bool InterruptableDelay::delay(uint32_t msec)
{
if (msec) {
DEBUG_MSG("delay %u ", msec);
// DEBUG_MSG("delay %u ", msec);
// sem take will return false if we timed out (i.e. were not interrupted)
bool r = xSemaphoreTake(semaphore, pdMS_TO_TICKS(msec));
DEBUG_MSG("interrupt=%d\n", r);
// DEBUG_MSG("interrupt=%d\n", r);
return !r;
} else {
return true;

View File

@@ -17,21 +17,12 @@ extern InterruptableDelay mainDelay;
/**
* @brief Base threading
*
* This is a pseudo threading layer that is super easy to port, well suited to our slow network and very ram & power efficient.
*
* TODO FIXME @geeksville
*
* make bluetooth wake cpu immediately (because it puts a message in a queue?)
*
* don't sleep at all if in POWER mode
*
* wake for serial character received
*
* add concept of 'low priority' threads that are not used to block sleep?
*
* make everything use osthread
*
* if we wake once because of a ble packet we might need to run loop multiple times before we can truely sleep
*
* move more things into OSThreads
* remove lock/lockguard
*
* move typedQueue into concurrency