mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Split power work into own thread
Completely forseeable issue. Now that we have _more_ ram available, this is a good option to split power related items out into their own thread.
This commit is contained in:
@@ -107,7 +107,6 @@ inline void readAccelerometer(int16_t &tx, int16_t &ty, int16_t &tz, Orientation
|
||||
}
|
||||
}
|
||||
void startMOVTask(void const *argument __unused) {
|
||||
postRToSInit();
|
||||
detectAccelerometerVersion();
|
||||
osDelay(TICKS_100MS / 2); // wait ~50ms for setup of accel to finalise
|
||||
lastMovementTime = 0;
|
||||
@@ -168,6 +167,5 @@ void startMOVTask(void const *argument __unused) {
|
||||
}
|
||||
|
||||
osDelay(TICKS_100MS); // Slow down update rate
|
||||
power_check();
|
||||
}
|
||||
}
|
||||
|
||||
27
workspace/TS100/Core/Threads/POWThread.cpp
Normal file
27
workspace/TS100/Core/Threads/POWThread.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* POWThread.cpp
|
||||
*
|
||||
* Created on: 16 Jan 2021
|
||||
* Author: Ralim
|
||||
*/
|
||||
|
||||
#include "BSP.h"
|
||||
#include "FreeRTOS.h"
|
||||
#include "QC3.h"
|
||||
#include "Settings.h"
|
||||
#include "cmsis_os.h"
|
||||
#include "main.hpp"
|
||||
#include "stdlib.h"
|
||||
#include "task.h"
|
||||
|
||||
// Small worker thread to handle power (mostly QC) related steps
|
||||
|
||||
|
||||
|
||||
void startPOWTask(void const *argument __unused) {
|
||||
postRToSInit();
|
||||
for (;;) {
|
||||
osDelay(TICKS_100MS); // Slow down update rate
|
||||
power_check();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user