Select missions with right encoder
This commit is contained in:
@ -1,8 +0,0 @@
|
||||
#ifndef __INC_GRAPHICS_H
|
||||
#define __INC_GRAPHICS_H
|
||||
|
||||
#include "tx_port.h"
|
||||
|
||||
void graphics_thread_entry(ULONG _);
|
||||
|
||||
#endif // __INC_GRAPHICS_H
|
||||
@ -4,9 +4,17 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void HX8357D_WriteData(uint8_t *data, size_t data_len);
|
||||
void HX8357D_WriteReg(uint8_t addr, uint8_t *data, size_t data_len);
|
||||
void HX8357D_Init();
|
||||
void HX8357D_Mode_RGB666();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __HX8357D_H
|
||||
|
||||
@ -31,7 +31,7 @@ extern "C" {
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
#include "tx_api.h"
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
@ -42,6 +42,7 @@ extern "C" {
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/* USER CODE BEGIN EC */
|
||||
extern volatile int ltdc_cb_triggered;
|
||||
extern TX_QUEUE ui_queue;
|
||||
/* USER CODE END EC */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
@ -61,12 +62,16 @@ void Error_Handler(void);
|
||||
/* Private defines -----------------------------------------------------------*/
|
||||
#define ENC1A_Pin GPIO_PIN_3
|
||||
#define ENC1A_GPIO_Port GPIOE
|
||||
#define ENC1A_EXTI_IRQn EXTI3_IRQn
|
||||
#define ENC1B_Pin GPIO_PIN_4
|
||||
#define ENC1B_GPIO_Port GPIOE
|
||||
#define ENC1B_EXTI_IRQn EXTI4_IRQn
|
||||
#define ENC2A_Pin GPIO_PIN_5
|
||||
#define ENC2A_GPIO_Port GPIOE
|
||||
#define ENC2A_EXTI_IRQn EXTI9_5_IRQn
|
||||
#define ENC2B_Pin GPIO_PIN_6
|
||||
#define ENC2B_GPIO_Port GPIOE
|
||||
#define ENC2B_EXTI_IRQn EXTI9_5_IRQn
|
||||
#define BTN1_Pin GPIO_PIN_0
|
||||
#define BTN1_GPIO_Port GPIOF
|
||||
#define BTN2_Pin GPIO_PIN_1
|
||||
|
||||
@ -52,6 +52,9 @@ void MemManage_Handler(void);
|
||||
void BusFault_Handler(void);
|
||||
void UsageFault_Handler(void);
|
||||
void DebugMon_Handler(void);
|
||||
void EXTI3_IRQHandler(void);
|
||||
void EXTI4_IRQHandler(void);
|
||||
void EXTI9_5_IRQHandler(void);
|
||||
void TIM6_DAC_IRQHandler(void);
|
||||
void LTDC_IRQHandler(void);
|
||||
/* USER CODE BEGIN EFP */
|
||||
|
||||
@ -2,5 +2,15 @@
|
||||
#define __INC_STW_DEFINES_H
|
||||
|
||||
#define NUM_MISSIONS 7
|
||||
typedef enum {
|
||||
MISSION_NONE = 0,
|
||||
MISSION_ACCEL = 1,
|
||||
MISSION_SKIDPAD = 2,
|
||||
MISSION_AUTOX = 3,
|
||||
MISSION_TRACKDRIVE = 4,
|
||||
MISSION_EBS = 5,
|
||||
MISSION_INSPECTION = 6,
|
||||
MISSION_MANUAL = 7
|
||||
} Mission;
|
||||
|
||||
#endif // __INC_STW_DEFINES_H
|
||||
|
||||
28
Core/Inc/ui.h
Normal file
28
Core/Inc/ui.h
Normal file
@ -0,0 +1,28 @@
|
||||
#ifndef __INC_ui_H
|
||||
#define __INC_ui_H
|
||||
|
||||
#include "tx_port.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define NUM_BUTTONS 6
|
||||
#define NUM_ENCS 2
|
||||
#define BUTTON_MIN_PRESS_TIME 50 // ms
|
||||
#define ENC_MAX_PHASE 50 // ms
|
||||
|
||||
typedef enum { UMK_BTN_RELEASED, UMK_ENC_CW, UMK_ENC_CCW } UIMessageKind;
|
||||
|
||||
typedef struct {
|
||||
UIMessageKind kind;
|
||||
int number;
|
||||
} UIMessage;
|
||||
|
||||
void ui_thread_entry(ULONG _);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __INC_ui_H
|
||||
Reference in New Issue
Block a user