A Hardware Hacking Tool with Web-Based CLI That Speaks Every Protocol
C arduinobluetoothcan-busdebuggingeepromesp32flipperzerogpiohardware-hackingi2cjtagopenocdprotocolspwmradiorfidspisubghzuartwifi
add input for stampS3
Geoc694250377b1
diff --git a/src/Inputs/StampS3Input.cpp b/src/Inputs/StampS3Input.cppnew file mode 100644index 00000000..73926d6e--- /dev/null+++ b/src/Inputs/StampS3Input.cpp@@ -0,0 +1,36 @@+#ifdef DEVICE_M5STAMPS3++#include "Inputs/StampS3Input.h"+#include "Inputs/InputKeys.h"++StampS3Input::StampS3Input() {+ M5.begin();+}++char StampS3Input::mapButton() {+ M5.update();++ if (M5.BtnA.wasPressed()) return KEY_OK;++ return KEY_NONE;+}++char StampS3Input::readChar() {+ return mapButton();+}++char StampS3Input::handler() {+ char c = KEY_NONE;+ while ((c = mapButton()) == KEY_NONE) {+ delay(10);+ }+ return c;+}++void StampS3Input::waitPress() {+ while (mapButton() == KEY_NONE) {+ delay(10);+ }+}++#endifdiff --git a/src/Inputs/StampS3Input.h b/src/Inputs/StampS3Input.hnew file mode 100644index 00000000..fb6bb23d--- /dev/null+++ b/src/Inputs/StampS3Input.h@@ -0,0 +1,20 @@+#pragma once++#ifdef DEVICE_M5STAMPS3++#include "Interfaces/IInput.h"+#include <M5Unified.h>++class StampS3Input : public IInput {+public:+ StampS3Input();++ char readChar() override;+ char handler() override;+ void waitPress() override;++private:+ char mapButton();+};++#endif\ No newline at end of file