summaryrefslogtreecommitdiff
path: root/src/buttonhandler/ButtonHandler.h
diff options
context:
space:
mode:
authorRiku Isokoski <riksu9000@gmail.com>2021-10-25 13:57:29 (GMT)
committerRiku Isokoski <riksu9000@gmail.com>2021-10-25 13:57:29 (GMT)
commit351c60a13167c05dfdbb0516f84077a4cd6adeec (patch)
treec4333ce60c6889411f9af04b544cd3ac4c4eef58 /src/buttonhandler/ButtonHandler.h
parentb19a2a760b74f27c8d3db262bf43437f722f74bd (diff)
Return button action instead of pushing messages
Diffstat (limited to 'src/buttonhandler/ButtonHandler.h')
-rw-r--r--src/buttonhandler/ButtonHandler.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buttonhandler/ButtonHandler.h b/src/buttonhandler/ButtonHandler.h
index b4c36bd..44b20f1 100644
--- a/src/buttonhandler/ButtonHandler.h
+++ b/src/buttonhandler/ButtonHandler.h
@@ -1,5 +1,6 @@
#pragma once
+#include "ButtonActions.h"
#include "systemtask/SystemTask.h"
#include <FreeRTOS.h>
#include <timers.h>
@@ -10,11 +11,10 @@ namespace Pinetime {
public:
enum class Events : uint8_t { Press, Release, Timer };
void Init(Pinetime::System::SystemTask* systemTask);
- void HandleEvent(Events event);
+ ButtonActions HandleEvent(Events event);
private:
enum class States : uint8_t { Idle, Pressed, Holding, LongHeld };
- Pinetime::System::SystemTask* systemTask = nullptr;
TickType_t releaseTime = 0;
TimerHandle_t buttonTimer;
bool buttonPressed = false;