ADD mail box for gear device
This commit is contained in:
@@ -26,20 +26,29 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/constants.hpp"
|
||||
#include "mbed.h"
|
||||
|
||||
namespace multi_tasking {
|
||||
|
||||
class GearDevice {
|
||||
public:
|
||||
GearDevice(Callback<void()> cbOnUp,
|
||||
Callback<void()> cbOnDown); // NOLINT(runtime/references)
|
||||
explicit GearDevice(Mail<uint8_t, 16>* mailBox); // NOLINT(runtime/references)
|
||||
|
||||
// make the class non copyable
|
||||
GearDevice(GearDevice&) = delete;
|
||||
GearDevice& operator=(GearDevice&) = delete;
|
||||
|
||||
// method called for updating the bike system
|
||||
void onUp();
|
||||
void onDown();
|
||||
|
||||
void sendMail(uint32_t data);
|
||||
|
||||
private:
|
||||
// data members
|
||||
volatile uint8_t _currentGear = bike_computer::kMinGear;
|
||||
Mail<uint8_t, 16>* _mailBox;
|
||||
};
|
||||
|
||||
} // namespace multi_tasking
|
||||
|
||||
Reference in New Issue
Block a user