-
Notifications
You must be signed in to change notification settings - Fork 949
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #465 from geeksville/coroutine
Lightweight thread refactoring
- Loading branch information
Showing
59 changed files
with
789 additions
and
829 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
|
||
export VERSION=1.1.2 | ||
export VERSION=1.1.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,5 +20,6 @@ | |
#define EVENT_POWER_DISCONNECTED 14 | ||
|
||
extern Fsm powerFSM; | ||
extern State statePOWER; | ||
|
||
void PowerFSM_setup(); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include "concurrency/BinarySemaphoreFreeRTOS.h" | ||
#include "configuration.h" | ||
|
||
#ifdef HAS_FREE_RTOS | ||
|
||
namespace concurrency | ||
{ | ||
|
||
BinarySemaphoreFreeRTOS::BinarySemaphoreFreeRTOS() | ||
{ | ||
semaphore = xSemaphoreCreateBinary(); | ||
} | ||
|
||
BinarySemaphoreFreeRTOS::~BinarySemaphoreFreeRTOS() | ||
{ | ||
vSemaphoreDelete(semaphore); | ||
} | ||
|
||
/** | ||
* Returns false if we were interrupted | ||
*/ | ||
bool BinarySemaphoreFreeRTOS::take(uint32_t msec) | ||
{ | ||
return xSemaphoreTake(semaphore, pdMS_TO_TICKS(msec)); | ||
} | ||
|
||
void BinarySemaphoreFreeRTOS::give() | ||
{ | ||
xSemaphoreGive(semaphore); | ||
} | ||
|
||
IRAM_ATTR void BinarySemaphoreFreeRTOS::giveFromISR(BaseType_t *pxHigherPriorityTaskWoken) | ||
{ | ||
xSemaphoreGiveFromISR(semaphore, pxHigherPriorityTaskWoken); | ||
} | ||
|
||
} // namespace concurrency | ||
|
||
#endif |
Oops, something went wrong.