Files
Smartknob/firmware/src/interface_task.h
Scott Bezek b47fcf7da4 Firmware updates - sensors, calibration, View support, etc (#9)
- Modify TLV493d library to expose frame counter in order to check for lockup, and implement auto-reset in tlv_sensor in case of lockup
 - Implement MT6701 SimpleFOC sensor
 - Make display optional
 - Add optional LED, strain, ALS support
 - Connect ALS to LED and display brightness
 - Hardcoded strain gauge thresholds and haptic feedback
2022-03-10 19:05:49 -08:00

30 lines
736 B
C++

#pragma once
#include <AceButton.h>
#include <Arduino.h>
#include "display_task.h"
#include "motor_task.h"
#include "task.h"
class InterfaceTask : public Task<InterfaceTask>, public ace_button::IEventHandler {
friend class Task<InterfaceTask>; // Allow base Task to invoke protected run()
public:
InterfaceTask(const uint8_t task_core, MotorTask& motor_task, DisplayTask* display_task);
~InterfaceTask();
void handleEvent(ace_button::AceButton* button, uint8_t event_type, uint8_t button_state) override;
protected:
void run();
private:
MotorTask& motor_task_;
DisplayTask* display_task_;
int current_config_ = 0;
void changeConfig(bool next);
};