Display and UI implementation (#169)
* Menu app. Lib: add mlib submodule. * Menu: new startup lib dependency definition * Menu: hierarchy in menu. Cube: fix heap1/4 inconsistency, stack protection. * GUI: rendering pipeline initial version. * GUI: layered widget composing, FURI record. Menu: FURI record, api. * GUI: input dispatching. Menu: switch to input from GUI. * GUI, MENU: code style cleanup, fix type conversion warnings. * GUI, Menu: syntax check. * Makefile: check and reinit submodules, format. * Menu: lock on event processing. Makefile: proper submodule initialization. * Menu: fix stack corruption by queue. * GUI: refactor. * Makefile: format rule fix, st-util pid. * GUI, Menu, FURI: format with clang-format. * GUI, MENU: locks in critical sections, fix stack corruption, ready signaling. * Makefile: clang format rule cleanup. * GUI,MENU: migrate to new API. * Applications: PRODUCTION_HW variable, skip drivers build on local target. * refactor production build * add git to dockerfile * GUI: uncomment lock block Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
This commit is contained in:
@@ -51,6 +51,10 @@
|
||||
#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
|
||||
#include <stdint.h>
|
||||
extern uint32_t SystemCoreClock;
|
||||
/* USER CODE BEGIN 0 */
|
||||
extern void configureTimerForRunTimeStats(void);
|
||||
extern unsigned long getRunTimeCounterValue(void);
|
||||
/* USER CODE END 0 */
|
||||
#endif
|
||||
#define configENABLE_FPU 0
|
||||
#define configENABLE_MPU 0
|
||||
@@ -64,15 +68,18 @@
|
||||
#define configTICK_RATE_HZ ((TickType_t)1000)
|
||||
#define configMAX_PRIORITIES ( 56 )
|
||||
#define configMINIMAL_STACK_SIZE ((uint16_t)128)
|
||||
#define configTOTAL_HEAP_SIZE ((size_t)8192)
|
||||
#define configTOTAL_HEAP_SIZE ((size_t)40960)
|
||||
#define configMAX_TASK_NAME_LEN ( 16 )
|
||||
#define configGENERATE_RUN_TIME_STATS 1
|
||||
#define configUSE_TRACE_FACILITY 1
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
#define configUSE_MUTEXES 1
|
||||
#define configQUEUE_REGISTRY_SIZE 8
|
||||
#define configCHECK_FOR_STACK_OVERFLOW 1
|
||||
#define configUSE_RECURSIVE_MUTEXES 1
|
||||
#define configUSE_COUNTING_SEMAPHORES 1
|
||||
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
|
||||
#define configRECORD_STACK_HIGH_ADDRESS 1
|
||||
/* USER CODE BEGIN MESSAGE_BUFFER_LENGTH_TYPE */
|
||||
/* Defaults to size_t for backward compatibility, but can be changed
|
||||
if lengths will always be less than the number of bytes in a size_t. */
|
||||
@@ -152,6 +159,12 @@ standard names. */
|
||||
|
||||
#define xPortSysTickHandler SysTick_Handler
|
||||
|
||||
/* USER CODE BEGIN 2 */
|
||||
/* Definitions needed when configGENERATE_RUN_TIME_STATS is on */
|
||||
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS configureTimerForRunTimeStats
|
||||
#define portGET_RUN_TIME_COUNTER_VALUE getRunTimeCounterValue
|
||||
/* USER CODE END 2 */
|
||||
|
||||
/* USER CODE BEGIN Defines */
|
||||
/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */
|
||||
/* USER CODE END Defines */
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
#include <stdlib.h>
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
@@ -75,7 +75,23 @@ extern void MX_USB_DEVICE_Init(void);
|
||||
void MX_FREERTOS_Init(void); /* (MISRA C 2004 rule 8.1) */
|
||||
|
||||
/* Hook prototypes */
|
||||
void configureTimerForRunTimeStats(void);
|
||||
unsigned long getRunTimeCounterValue(void);
|
||||
void vApplicationIdleHook(void);
|
||||
void vApplicationStackOverflowHook(xTaskHandle xTask, signed char *pcTaskName);
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
/* Functions needed when configGENERATE_RUN_TIME_STATS is on */
|
||||
__weak void configureTimerForRunTimeStats(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
__weak unsigned long getRunTimeCounterValue(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
/* USER CODE END 1 */
|
||||
|
||||
/* USER CODE BEGIN 2 */
|
||||
__weak void vApplicationIdleHook( void )
|
||||
@@ -92,6 +108,16 @@ __weak void vApplicationIdleHook( void )
|
||||
}
|
||||
/* USER CODE END 2 */
|
||||
|
||||
/* USER CODE BEGIN 4 */
|
||||
__weak void vApplicationStackOverflowHook(xTaskHandle xTask, signed char *pcTaskName)
|
||||
{
|
||||
/* Run time stack overflow checking is performed if
|
||||
configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook function is
|
||||
called if a stack overflow is detected. */
|
||||
exit(255);
|
||||
}
|
||||
/* USER CODE END 4 */
|
||||
|
||||
/**
|
||||
* @brief FreeRTOS initialization
|
||||
* @param None
|
||||
|
@@ -86,7 +86,9 @@ void NMI_Handler(void)
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN HardFault_IRQn 0 */
|
||||
|
||||
if ((*(volatile uint32_t *)CoreDebug_BASE) & (1 << 0)) {
|
||||
__asm("bkpt 1");
|
||||
}
|
||||
/* USER CODE END HardFault_IRQn 0 */
|
||||
while (1)
|
||||
{
|
||||
|
@@ -97,6 +97,7 @@ PB14.GPIOParameters=GPIO_Speed,PinState,GPIO_Label,GPIO_ModeDefaultOutputPP
|
||||
NVIC.EXTI2_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true
|
||||
RCC.PLLPoutputFreq_Value=18285714.285714287
|
||||
RCC.APB1TimFreq_Value=64000000
|
||||
FREERTOS.configGENERATE_RUN_TIME_STATS=1
|
||||
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||
RCC.LPUART1Freq_Value=64000000
|
||||
USB_OTG_FS.IPParameters=VirtualMode
|
||||
@@ -123,6 +124,7 @@ PC13.Locked=true
|
||||
ADC1.OffsetNumber-0\#ChannelRegularConversion=ADC_OFFSET_NONE
|
||||
PC13.Signal=GPXTI13
|
||||
RCC.SWPMI1Freq_Value=64000000
|
||||
FREERTOS.configCHECK_FOR_STACK_OVERFLOW=1
|
||||
PB8.GPIO_PuPd=GPIO_PULLDOWN
|
||||
PC6.Signal=GPIO_Output
|
||||
PC2.Signal=GPXTI2
|
||||
@@ -182,8 +184,8 @@ SPI1.Mode=SPI_MODE_MASTER
|
||||
Mcu.Pin39=PA15 (JTDI)
|
||||
PB3\ (JTDO-TRACESWO).Mode=TX_Only_Simplex_Unidirect_Master
|
||||
RCC.RNGFreq_Value=48000000
|
||||
VP_ADC1_TempSens_Input.Signal=ADC1_TempSens_Input
|
||||
PC2.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultEXTI
|
||||
VP_ADC1_TempSens_Input.Signal=ADC1_TempSens_Input
|
||||
Mcu.Pin30=PC8
|
||||
PA1.GPIO_Label=BUTTON_DOWN
|
||||
Mcu.Pin33=PA9
|
||||
@@ -310,7 +312,7 @@ PB9.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_RISING_FALLING
|
||||
Mcu.Pin7=PC2
|
||||
Mcu.Pin8=PC3
|
||||
Mcu.Pin9=PA0
|
||||
FREERTOS.IPParameters=Tasks01,configTOTAL_HEAP_SIZE,HEAP_NUMBER,configUSE_TIMERS,configUSE_IDLE_HOOK,FootprintOK
|
||||
FREERTOS.IPParameters=Tasks01,configTOTAL_HEAP_SIZE,HEAP_NUMBER,configUSE_TIMERS,configUSE_IDLE_HOOK,FootprintOK,configCHECK_FOR_STACK_OVERFLOW,configRECORD_STACK_HIGH_ADDRESS,configGENERATE_RUN_TIME_STATS
|
||||
RCC.AHBFreq_Value=64000000
|
||||
Mcu.Pin0=PC13
|
||||
SPI3.DataSize=SPI_DATASIZE_8BIT
|
||||
@@ -342,7 +344,7 @@ PB7.Signal=GPIO_Input
|
||||
PB8.Locked=true
|
||||
PB6.GPIOParameters=GPIO_Speed,GPIO_Label
|
||||
PB0.Locked=true
|
||||
FREERTOS.configTOTAL_HEAP_SIZE=8192
|
||||
FREERTOS.configTOTAL_HEAP_SIZE=40960
|
||||
VP_COMP1_VS_VREFINT12.Mode=VREFINT_12
|
||||
ProjectManager.ProjectName=cube
|
||||
PB1.PinState=GPIO_PIN_SET
|
||||
@@ -405,6 +407,7 @@ PA9.Mode=Asynchronous
|
||||
PB4\ (NJTRST).GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultEXTI
|
||||
NVIC.TIM8_CC_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true
|
||||
PB14.PinState=GPIO_PIN_SET
|
||||
FREERTOS.configRECORD_STACK_HIGH_ADDRESS=1
|
||||
ProjectManager.TargetToolchain=Makefile
|
||||
PB10.GPIO_Label=DISPLAY_RST
|
||||
PB7.GPIOParameters=GPIO_Label
|
||||
|
@@ -57,7 +57,7 @@ C_SOURCES += \
|
||||
$(CUBE_DIR)/Middlewares/Third_Party/FreeRTOS/Source/tasks.c \
|
||||
$(CUBE_DIR)/Middlewares/Third_Party/FreeRTOS/Source/timers.c \
|
||||
$(CUBE_DIR)/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c \
|
||||
$(CUBE_DIR)/Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_1.c \
|
||||
$(CUBE_DIR)/Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c \
|
||||
$(CUBE_DIR)/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c \
|
||||
$(CUBE_DIR)/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c \
|
||||
$(CUBE_DIR)/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c \
|
||||
|
Reference in New Issue
Block a user