ADD mail box for pedal device
This commit is contained in:
@@ -53,9 +53,6 @@ class BikeSystem {
|
||||
// method called in main() for starting the system
|
||||
void start();
|
||||
|
||||
// method called in main() for starting the sysytem with the event queue
|
||||
void startWithEventQueue();
|
||||
|
||||
// method called for stopping the system
|
||||
void stop();
|
||||
|
||||
@@ -66,24 +63,32 @@ class BikeSystem {
|
||||
private:
|
||||
// private methods
|
||||
void init();
|
||||
// Main Thread
|
||||
void temperatureTask();
|
||||
void displayTask1();
|
||||
void displayTask2();
|
||||
void cpuTask();
|
||||
|
||||
// ISR Thread
|
||||
void onReset();
|
||||
void onGearUp();
|
||||
void onGearDown();
|
||||
void gearUpTask();
|
||||
void gearDownTask();
|
||||
void speedDistanceTask();
|
||||
void temperatureTask();
|
||||
void resetTask();
|
||||
void displayTask1();
|
||||
void displayTask2();
|
||||
void cpuTask();
|
||||
//
|
||||
|
||||
uint8_t getCurrentGear();
|
||||
uint8_t getCurrentGearSize();
|
||||
uint32_t getCurrentSpeed();
|
||||
uint32_t getCurrentDistance();
|
||||
|
||||
void setCurrentGear(uint8_t gear);
|
||||
|
||||
void dispatch_isr_events();
|
||||
void dispatch_events();
|
||||
void loop_speed_distance_task();
|
||||
|
||||
// timer instance used for loggint task time and used by ResetDevice
|
||||
std::chrono::microseconds _resetTime = std::chrono::microseconds::zero();
|
||||
@@ -130,12 +135,19 @@ class BikeSystem {
|
||||
EventQueue _isrEventQueue;
|
||||
EventQueue _eventQueue;
|
||||
|
||||
// Mail
|
||||
Mail<uint32_t, 16> _mailPedalDevice;
|
||||
|
||||
// mutex for shared resource
|
||||
Mutex mutexGearSize;
|
||||
Mutex mutexGear;
|
||||
Mutex _mutexGearSize;
|
||||
Mutex _mutexGear;
|
||||
Mutex _mutexSpeed;
|
||||
Mutex _mutexDistance;
|
||||
Mutex _mutexSpeedometer;
|
||||
|
||||
// Tread for isr events
|
||||
Thread _isrEventThread;
|
||||
Thread _speedDistanceThread;
|
||||
};
|
||||
|
||||
} // namespace multi_tasking
|
||||
|
||||
Reference in New Issue
Block a user