mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
All Ticks as the right TickType
Update usb-pd
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
#include "settingsGUI.hpp"
|
||||
#include "task.h"
|
||||
#include <Buttons.hpp>
|
||||
uint32_t lastButtonTime = 0;
|
||||
TickType_t lastButtonTime = 0;
|
||||
|
||||
ButtonState getButtonState() {
|
||||
/*
|
||||
@@ -22,10 +22,10 @@ ButtonState getButtonState() {
|
||||
* press (buttons still down), or if release we trigger press
|
||||
* (downtime>filter)
|
||||
*/
|
||||
static uint8_t previousState = 0;
|
||||
static uint32_t previousStateChange = 0;
|
||||
const uint16_t timeout = TICKS_100MS * 4;
|
||||
uint8_t currentState;
|
||||
static uint8_t previousState = 0;
|
||||
static TickType_t previousStateChange = 0;
|
||||
const TickType_t timeout = TICKS_100MS * 4;
|
||||
uint8_t currentState;
|
||||
currentState = (getButtonA()) << 0;
|
||||
currentState |= (getButtonB()) << 1;
|
||||
|
||||
@@ -95,7 +95,7 @@ void waitForButtonPress() {
|
||||
}
|
||||
}
|
||||
|
||||
void waitForButtonPressOrTimeout(uint32_t timeout) {
|
||||
void waitForButtonPressOrTimeout(TickType_t timeout) {
|
||||
timeout += xTaskGetTickCount();
|
||||
// calculate the exit point
|
||||
|
||||
|
||||
Reference in New Issue
Block a user