Compare commits

...

3 Commits

Author SHA1 Message Date
19f51f13c4 Revert changes 2024-06-05 17:49:54 +02:00
6d92da3a10 add mock buttons 2024-05-23 21:33:52 +02:00
9ef44b8ebb Add code for constant CAN message sending 2024-05-23 21:25:35 +02:00
2 changed files with 9 additions and 7 deletions

View File

@ -9,8 +9,8 @@ extern "C" {
#define NUM_BUTTONS 6
#define NUM_ENCS 2
#define BUTTON_MIN_INTERVAL 50 // ms
#define ENC_MAX_PHASE 50 // ms
#define BUTTON_MIN_INTERVAL 50 // ms
#define ENC_MAX_PHASE 50 // ms
typedef enum { UMK_BTN_PRESSED, UMK_ENC_CW, UMK_ENC_CCW } ButtonMessageKind;
@ -25,4 +25,4 @@ void ui_thread_entry(ULONG _);
}
#endif
#endif // __INC_ui_H
#endif // __INC_ui_H

View File

@ -1,14 +1,14 @@
#include "ui.h"
#include <stdint.h>
#include "hx8357d.h"
#include "main.h"
#include "stm32h7a3xx.h"
#include "stm32h7xx_hal.h"
#include "stm32h7xx_hal_gpio.h"
#include "tx_api.h"
#include "hx8357d.h"
#include "main.h"
#include "vehicle.h"
#include <stdint.h>
void ui_thread_entry(ULONG _) {
GPIO_TypeDef *button_ports[NUM_BUTTONS] = {BTN1_GPIO_Port, BTN2_GPIO_Port,
@ -43,7 +43,9 @@ void ui_thread_entry(ULONG _) {
if (press_event == 1 && button_states[1]) {
tx_event_flags_set(&gui_update_events, GUI_UPDATE_NEXT_SCREEN, TX_OR);
}
vehicle_broadcast_buttons(button_states);
// Release so other threads can get scheduled
tx_thread_sleep(1);
}