Cleanup and improvements (#194)
- Lots of changes for migrating C code to C++ - Improved `Lockable` in several ways like adding `withLock()` (+ tests) - Improved `Semaphore` a bit for improved readability, and also added some tests - Upgrade Linux machine in GitHub Actions so that we can compile with a newer GCC - Simplification of WiFi connection - Updated funding options - (and more)
This commit is contained in:
committed by
GitHub
parent
1bb1260ea0
commit
6c67845645
@@ -11,8 +11,8 @@ static portMUX_TYPE critical_mutex;
|
||||
|
||||
namespace tt::kernel::critical {
|
||||
|
||||
TtCriticalInfo enter() {
|
||||
TtCriticalInfo info = {
|
||||
CriticalInfo enter() {
|
||||
CriticalInfo info = {
|
||||
.isrm = 0,
|
||||
.fromIsr = TT_IS_ISR(),
|
||||
.kernelRunning = (xTaskGetSchedulerState() == taskSCHEDULER_RUNNING)
|
||||
@@ -29,7 +29,7 @@ TtCriticalInfo enter() {
|
||||
return info;
|
||||
}
|
||||
|
||||
void exit(TtCriticalInfo info) {
|
||||
void exit(CriticalInfo info) {
|
||||
if (info.fromIsr) {
|
||||
taskEXIT_CRITICAL_FROM_ISR(info.isrm);
|
||||
} else if (info.kernelRunning) {
|
||||
|
||||
@@ -4,21 +4,21 @@
|
||||
|
||||
namespace tt::kernel::critical {
|
||||
|
||||
typedef struct {
|
||||
struct CriticalInfo {
|
||||
uint32_t isrm;
|
||||
bool fromIsr;
|
||||
bool kernelRunning;
|
||||
} TtCriticalInfo;
|
||||
};
|
||||
|
||||
/** Enter a critical section
|
||||
* @return info on the status
|
||||
*/
|
||||
TtCriticalInfo enter();
|
||||
CriticalInfo enter();
|
||||
|
||||
/**
|
||||
* Exit a critical section
|
||||
* @param[in] info the info from when the critical section was started
|
||||
*/
|
||||
void exit(TtCriticalInfo info);
|
||||
void exit(CriticalInfo info);
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user