feat(os): 添加 uC/OS-II 实时操作系统支持
- 在项目中集成 uC/OS-II 源代码和配置文件 - 修改 CMakeLists.txt 以包含 uC/OS-II 相关路径和源文件 - 更新 main.c 以使用 uC/OS-II 创建任务和管理调度 - 移除原有的裸机程序结构,为使用操作系统做准备
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@
|
|||||||
!embedding.ioc
|
!embedding.ioc
|
||||||
!Makefile
|
!Makefile
|
||||||
!CMakeLists.txt
|
!CMakeLists.txt
|
||||||
|
!startup_stm32f103xe.s
|
||||||
|
@ -54,23 +54,26 @@ target_sources(${CMAKE_PROJECT_NAME} PRIVATE
|
|||||||
# SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_GCC.c
|
# SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_GCC.c
|
||||||
libs/ge_interface/ge_input.c
|
libs/ge_interface/ge_input.c
|
||||||
libs/ge_interface/ge_render.c
|
libs/ge_interface/ge_render.c
|
||||||
|
libs/ge_interface/ge_timer.c
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add include paths
|
# Add include paths
|
||||||
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
|
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
|
||||||
# Add user defined include paths
|
# Add user defined include paths
|
||||||
libs
|
libs
|
||||||
# Core/Inc
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add project symbols (macros)
|
# Add project symbols (macros)
|
||||||
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
|
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
|
||||||
# Add user defined symbols
|
# Add user defined symbols
|
||||||
|
__USE_UCOS2__
|
||||||
)
|
)
|
||||||
|
|
||||||
|
add_subdirectory(libs/uC-OS2)
|
||||||
# Add linked libraries
|
# Add linked libraries
|
||||||
target_link_libraries(${CMAKE_PROJECT_NAME}
|
target_link_libraries(${CMAKE_PROJECT_NAME}
|
||||||
stm32cubemx
|
stm32cubemx
|
||||||
|
|
||||||
# Add user defined libraries
|
# Add user defined libraries
|
||||||
|
uCOS2
|
||||||
)
|
)
|
||||||
|
164
Core/Src/main.c
164
Core/Src/main.c
@ -26,15 +26,9 @@
|
|||||||
#include <logger.h>
|
#include <logger.h>
|
||||||
#include <ge_interface/ge_interface.h>
|
#include <ge_interface/ge_interface.h>
|
||||||
|
|
||||||
#define RED 0xf800
|
#ifdef __USE_UCOS2__
|
||||||
#define GREEN 0x07e0
|
#include <ucos_ii.h>
|
||||||
#define BLUE 0x001f
|
#endif
|
||||||
#define WHITE 0xffff
|
|
||||||
#define BLACK 0x0000
|
|
||||||
#define YELLOW 0xFFE0
|
|
||||||
#define GRAY0 0xEF7D
|
|
||||||
#define GRAY1 0x8410
|
|
||||||
#define GRAY2 0x4208
|
|
||||||
|
|
||||||
/* USER CODE END Includes */
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
@ -67,6 +61,113 @@ void SystemClock_Config(void);
|
|||||||
|
|
||||||
/* Private user code ---------------------------------------------------------*/
|
/* Private user code ---------------------------------------------------------*/
|
||||||
/* USER CODE BEGIN 0 */
|
/* USER CODE BEGIN 0 */
|
||||||
|
#define TASK_SIZE 128
|
||||||
|
#define STACK_NUM 6
|
||||||
|
static OS_STK stacks[STACK_NUM][TASK_SIZE];
|
||||||
|
#define GET_STACK_TOP(number) ((OS_STK*)&stacks[number][TASK_SIZE - 1])
|
||||||
|
#define GET_STACK_BOTTOM(number) ((OS_STK*)&stacks[number][0])
|
||||||
|
#define _STR(str) # str
|
||||||
|
#define STR(str) _STR(str)
|
||||||
|
#define CREATE_TASK(func, args, stack_num, prio) \
|
||||||
|
OSTaskCreateExt(func, args, GET_STACK_TOP(stack_num), prio, stack_num, \
|
||||||
|
GET_STACK_BOTTOM(stack_num), TASK_SIZE, STR(func), OS_TASK_OPT_STK_CHK);
|
||||||
|
|
||||||
|
static void T_ledR(void* args) {
|
||||||
|
(void) args;
|
||||||
|
const int delay_s = 1;
|
||||||
|
while (1) {
|
||||||
|
GE_LED_OFF(R);
|
||||||
|
OSTimeDlyHMSM(0, 0, delay_s, 0);
|
||||||
|
GE_LED_ON(R);
|
||||||
|
OSTimeDlyHMSM(0, 0, delay_s, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void T_ledG(void* args) {
|
||||||
|
(void) args;
|
||||||
|
const int delay_s = 2;
|
||||||
|
while (1) {
|
||||||
|
GE_LED_OFF(G);
|
||||||
|
OSTimeDlyHMSM(0, 0, delay_s, 0);
|
||||||
|
GE_LED_ON(G);
|
||||||
|
OSTimeDlyHMSM(0, 0, delay_s, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void T_ledB(void* args) {
|
||||||
|
(void) args;
|
||||||
|
const int delay_s = 3;
|
||||||
|
while (1) {
|
||||||
|
GE_LED_OFF(B);
|
||||||
|
OSTimeDlyHMSM(0, 0, delay_s, 0);
|
||||||
|
GE_LED_ON(B);
|
||||||
|
OSTimeDlyHMSM(0, 0, delay_s, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void game_main(void* args) {
|
||||||
|
(void) args;
|
||||||
|
#define RED 0xf800
|
||||||
|
#define GREEN 0x07e0
|
||||||
|
#define BLUE 0x001f
|
||||||
|
#define WHITE 0xffff
|
||||||
|
#define BLACK 0x0000
|
||||||
|
#define YELLOW 0xFFE0
|
||||||
|
#define GRAY0 0xEF7D
|
||||||
|
#define GRAY1 0x8410
|
||||||
|
#define GRAY2 0x4208
|
||||||
|
ge_input_event_t ievent;
|
||||||
|
ge_render_rect_t player = {
|
||||||
|
.pos.x = 60,
|
||||||
|
.pos.y = 60,
|
||||||
|
.size.x = 8,
|
||||||
|
.size.y = 8,
|
||||||
|
};
|
||||||
|
int speed = 5;
|
||||||
|
|
||||||
|
ge_render.init_func(&ge_render, NULL);
|
||||||
|
while (1) {
|
||||||
|
input_btn_func(&ge_input);
|
||||||
|
while (ge_input.func_recv(&ge_input, &ievent) == 0) {
|
||||||
|
switch (ievent.num) {
|
||||||
|
case GE_ITYPE_KEY_1:
|
||||||
|
player.pos.x += speed;
|
||||||
|
break;
|
||||||
|
case GE_ITYPE_KEY_2:
|
||||||
|
player.pos.y -= speed;
|
||||||
|
break;
|
||||||
|
case GE_ITYPE_KEY_3:
|
||||||
|
player.pos.y += speed;
|
||||||
|
break;
|
||||||
|
case GE_ITYPE_KEY_4:
|
||||||
|
player.pos.x -= speed;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
LOG_INFO("%d pressd", ievent.num);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ge_render.func_draw_rect(&ge_render, &(ge_render_rect_t) {
|
||||||
|
.pos = {0, 0},
|
||||||
|
.size = ge_render.screen_size
|
||||||
|
}, WHITE);
|
||||||
|
ge_render.func_draw_rect(&ge_render, &player, RED);
|
||||||
|
ge_render.func_flush(&ge_render);
|
||||||
|
OSTimeDlyHMSM(0, 0, 0, 33);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void start_task(void *args) {
|
||||||
|
(void)args;
|
||||||
|
OS_CPU_SR cpu_sr=0;
|
||||||
|
OS_ENTER_CRITICAL();
|
||||||
|
CREATE_TASK(game_main, NULL, 4, 9);
|
||||||
|
CREATE_TASK(T_ledR, NULL, 1, 5);
|
||||||
|
CREATE_TASK(T_ledG, NULL, 2, 6);
|
||||||
|
CREATE_TASK(T_ledB, NULL, 3, 7);
|
||||||
|
OSTaskSuspend(10);
|
||||||
|
OS_EXIT_CRITICAL();
|
||||||
|
}
|
||||||
|
|
||||||
/* USER CODE END 0 */
|
/* USER CODE END 0 */
|
||||||
|
|
||||||
@ -101,52 +202,17 @@ int main(void)
|
|||||||
MX_GPIO_Init();
|
MX_GPIO_Init();
|
||||||
/* USER CODE BEGIN 2 */
|
/* USER CODE BEGIN 2 */
|
||||||
INIT_LOGGER();
|
INIT_LOGGER();
|
||||||
ge_render.init_func(&ge_render, 0);
|
OSInit();
|
||||||
ge_render_rect_t full_screen_rect = {
|
OSTaskCreate(start_task,(void *)0, GET_STACK_TOP(0), 10);//创建起始任务
|
||||||
.pos.x = 0,
|
OSStart();
|
||||||
.pos.y = 0,
|
// Never come here
|
||||||
.size = ge_render.screen_size,
|
Error_Handler();
|
||||||
};
|
|
||||||
ge_render.func_draw_rect(&ge_render, &full_screen_rect, WHITE);
|
|
||||||
// Assert(0);
|
|
||||||
/* USER CODE END 2 */
|
/* USER CODE END 2 */
|
||||||
|
|
||||||
/* Infinite loop */
|
/* Infinite loop */
|
||||||
/* USER CODE BEGIN WHILE */
|
/* USER CODE BEGIN WHILE */
|
||||||
ge_input_event_t ievent;
|
|
||||||
ge_render_rect_t player = {
|
|
||||||
.pos.x = 0,
|
|
||||||
.pos.y = 0,
|
|
||||||
.size.x = 10,
|
|
||||||
.size.y = 10,
|
|
||||||
};
|
|
||||||
int speed = 5;
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
input_btn_func(&ge_input);
|
|
||||||
while (ge_input.func_recv(&ge_input, &ievent) == 0) {
|
|
||||||
switch (ievent.num) {
|
|
||||||
case GE_ITYPE_KEY_1:
|
|
||||||
player.pos.x += speed;
|
|
||||||
break;
|
|
||||||
case GE_ITYPE_KEY_2:
|
|
||||||
player.pos.y -= speed;
|
|
||||||
break;
|
|
||||||
case GE_ITYPE_KEY_3:
|
|
||||||
player.pos.y += speed;
|
|
||||||
break;
|
|
||||||
case GE_ITYPE_KEY_4:
|
|
||||||
player.pos.x -= speed;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
LOG_INFO("%d pressd", ievent.num);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ge_render.func_draw_rect(&ge_render, &full_screen_rect, WHITE);
|
|
||||||
ge_render.func_draw_rect(&ge_render, &player, RED);
|
|
||||||
ge_render.func_flush(&ge_render);
|
|
||||||
HAL_Delay(33); // 去抖动延时
|
|
||||||
/* USER CODE END WHILE */
|
/* USER CODE END WHILE */
|
||||||
|
|
||||||
/* USER CODE BEGIN 3 */
|
/* USER CODE BEGIN 3 */
|
||||||
|
@ -5,6 +5,7 @@ cmake_minimum_required(VERSION 3.22)
|
|||||||
add_library(SEGGER_RTT STATIC
|
add_library(SEGGER_RTT STATIC
|
||||||
RTT/SEGGER_RTT.c
|
RTT/SEGGER_RTT.c
|
||||||
RTT/SEGGER_RTT_printf.c
|
RTT/SEGGER_RTT_printf.c
|
||||||
|
# RTT/SEGGER_RTT_ASM_ARMv7M.S
|
||||||
# 添加其他需要的源文件
|
# 添加其他需要的源文件
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ static inline void lcd_set_region(int pos_x, int pos_y, int size_x, int size_y)
|
|||||||
LCD_WRITE_INDEX(0x2c);
|
LCD_WRITE_INDEX(0x2c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lcd_draw_point(ge_render_t* ctx, const ge_render_pos2_t* pos, uint16_t color) {
|
static int lcd_draw_point(ge_render_t* ctx, const ge_render_pos2_t* pos, ge_render_color_t color) {
|
||||||
(void)ctx;
|
(void)ctx;
|
||||||
Assert(pos != NULL);
|
Assert(pos != NULL);
|
||||||
lcd_set_region(pos->x, pos->y, 1, 1);
|
lcd_set_region(pos->x, pos->y, 1, 1);
|
||||||
@ -200,7 +200,8 @@ static int lcd_draw_point(ge_render_t* ctx, const ge_render_pos2_t* pos, uint16_
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lcd_draw_rect(ge_render_t* ctx, const ge_render_rect_t* rect, uint16_t color) {
|
__unused
|
||||||
|
static int lcd_draw_rect(ge_render_t* ctx, const ge_render_rect_t* rect, ge_render_color_t color) {
|
||||||
(void)ctx;
|
(void)ctx;
|
||||||
const int pos_x = rect ? rect->pos.x : 0;
|
const int pos_x = rect ? rect->pos.x : 0;
|
||||||
const int pos_y = rect ? rect->pos.y : 0;
|
const int pos_y = rect ? rect->pos.y : 0;
|
||||||
@ -230,97 +231,103 @@ static int lcd_draw_rect(ge_render_t* ctx, const ge_render_rect_t* rect, uint16_
|
|||||||
|
|
||||||
#define SCREEN_HEIGHT 128
|
#define SCREEN_HEIGHT 128
|
||||||
#define SCREEN_WIDTH 128
|
#define SCREEN_WIDTH 128
|
||||||
|
#define HEAD_CANARY 0xDEAD
|
||||||
|
#define TAIL_CANARY 0xBEEF
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
GE_RENDER_EVEN_LINES, // 渲染偶数数行
|
GE_RENDER_EVEN_LINES, // 渲染偶数数行
|
||||||
GE_RENDER_ODD_LINES, // 渲染奇数数行
|
GE_RENDER_ODD_LINES, // 渲染奇数数行
|
||||||
} ge_render_field_t;
|
} ge_render_field_t;
|
||||||
static struct ge_content {
|
|
||||||
|
typedef struct ge_context {
|
||||||
|
ge_render_field_t current_field;
|
||||||
uint16_t head_canary;
|
uint16_t head_canary;
|
||||||
uint16_t screen_buffer[SCREEN_HEIGHT / 2][SCREEN_WIDTH];
|
uint16_t screen_buffer[SCREEN_HEIGHT / 2][SCREEN_WIDTH];
|
||||||
uint16_t tail_canary;
|
uint16_t tail_canary;
|
||||||
} ge_content;
|
} ge_context_t;
|
||||||
static ge_render_field_t current_field = GE_RENDER_EVEN_LINES;
|
|
||||||
|
|
||||||
#define CTX_BUF(ctx) (((struct ge_content*)ctx->context)->screen_buffer)
|
static int init(ge_render_t* render, const ge_render_pos2_t* init_screen_size) {
|
||||||
#define CTX_BUF_PTR(ctx, x, y) ((uint16_t*)CTX_BUF(ctx) + SCREEN_WIDTH * (y) + (x))
|
|
||||||
|
|
||||||
#define HEAD_CANARY 0xDEAD
|
|
||||||
#define TAIL_CANARY 0xBEEF
|
|
||||||
|
|
||||||
static int init(ge_render_t* ctx, const ge_render_pos2_t* init_screen_size) {
|
|
||||||
(void)init_screen_size;
|
(void)init_screen_size;
|
||||||
init_lcd();
|
init_lcd();
|
||||||
/**
|
/**
|
||||||
* set canary
|
* set canary
|
||||||
*/
|
*/
|
||||||
((struct ge_content*)ctx->context)->head_canary = HEAD_CANARY;
|
ge_context_t* ctx = (ge_context_t*) render->context;
|
||||||
((struct ge_content*)ctx->context)->tail_canary = TAIL_CANARY;
|
ctx->head_canary = HEAD_CANARY;
|
||||||
|
ctx->tail_canary = TAIL_CANARY;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int flush(ge_render_t* ctx) {
|
static int flush(ge_render_t* render) {
|
||||||
AssertFmt(((struct ge_content*)ctx->context)->head_canary == HEAD_CANARY, "Invalid head canary");
|
ge_context_t* ctx = (ge_context_t*) render->context;
|
||||||
AssertFmt(((struct ge_content*)ctx->context)->tail_canary == TAIL_CANARY, "Invalid tail canary");
|
AssertFmt(ctx->head_canary == HEAD_CANARY, "Invalid head canary");
|
||||||
uint16_t* buffer = ((struct ge_content*)ctx->context)->screen_buffer;
|
AssertFmt(ctx->tail_canary == TAIL_CANARY, "Invalid tail canary");
|
||||||
|
const ge_render_field_t current_field = ctx->current_field;
|
||||||
|
|
||||||
const int start_y = (current_field == GE_RENDER_EVEN_LINES) ? 0 : 1;
|
const int start_y = (current_field == GE_RENDER_EVEN_LINES) ? 0 : 1;
|
||||||
for (int buffer_y = 0; buffer_y < ctx->screen_size.y / 2; buffer_y++) {
|
for (int buffer_y = 0; buffer_y < render->screen_size.y / 2; buffer_y++) {
|
||||||
const int screen_y = start_y + buffer_y * 2;
|
const int screen_y = start_y + buffer_y * 2;
|
||||||
|
|
||||||
// 设置当前行区域 (1行高)
|
// 设置当前行区域 (1行高)
|
||||||
lcd_set_region(0, screen_y, ctx->screen_size.y, 1);
|
lcd_set_region(0, screen_y, render->screen_size.y, 1);
|
||||||
|
|
||||||
GE_FAST_SET_OFF(LCD_CS);
|
GE_FAST_SET_OFF(LCD_CS);
|
||||||
GE_FAST_SET_ON(LCD_DC);
|
GE_FAST_SET_ON(LCD_DC);
|
||||||
|
|
||||||
// 传输整行数据
|
// 传输整行数据
|
||||||
uint16_t* line_ptr = buffer + buffer_y * ctx->screen_size.x;
|
for (int x = 0; x < render->screen_size.x; x++) {
|
||||||
for (int x = 0; x < ctx->screen_size.x; x++) {
|
const uint16_t data = ctx->screen_buffer[buffer_y][x];
|
||||||
lcd_write_byte(*line_ptr >> 8); // 高字节
|
lcd_write_byte(data >> 8); // 高字节
|
||||||
lcd_write_byte(*line_ptr & 0xFF); // 低字节
|
lcd_write_byte(data & 0xFF); // 低字节
|
||||||
line_ptr++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GE_FAST_SET_ON(LCD_CS);
|
GE_FAST_SET_ON(LCD_CS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 切换模式
|
// 切换模式
|
||||||
current_field = (current_field == GE_RENDER_EVEN_LINES) ?
|
ctx->current_field = (current_field == GE_RENDER_EVEN_LINES) ?
|
||||||
GE_RENDER_ODD_LINES : GE_RENDER_EVEN_LINES;
|
GE_RENDER_ODD_LINES : GE_RENDER_EVEN_LINES;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int check_need_flush(ge_render_t* ctx, const ge_render_pos2_t* pos) {
|
static inline int check_need_flush(ge_render_t* render, const ge_render_pos2_t* pos) {
|
||||||
const int isOdd = pos->y % 2;
|
const int isOdd = pos->y % 2;
|
||||||
const int isNeedOdd = (current_field == GE_RENDER_ODD_LINES) ? 1 : 0;
|
const int isNeedOdd =
|
||||||
|
(((ge_context_t*) render->context)->current_field == GE_RENDER_ODD_LINES) ? 1 : 0;
|
||||||
return isOdd == isNeedOdd;
|
return isOdd == isNeedOdd;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int should_render_line(int y) {
|
static inline int should_render_line(ge_render_t* render, int y) {
|
||||||
return (y % 2) == (current_field == GE_RENDER_ODD_LINES);
|
return (y % 2) == (((ge_context_t*) render->context)->current_field == GE_RENDER_ODD_LINES);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int buf_draw_rect(ge_render_t* ctx, const ge_render_rect_t* rect, uint16_t color) {
|
static int buf_draw_rect(ge_render_t* render, const ge_render_rect_t* rect, ge_render_color_t color) {
|
||||||
Assert(ctx != NULL && rect != NULL);
|
Assert(render != NULL && rect != NULL);
|
||||||
|
|
||||||
// 只更新属于当前场的行
|
// 只更新属于当前场的行
|
||||||
for (int y = rect->pos.y; y < rect->pos.y + rect->size.y; y++) {
|
for (int y = rect->pos.y; y < rect->pos.y + rect->size.y; y++) {
|
||||||
if (!should_render_line(y)) {
|
if (!should_render_line(render, y)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (int x = rect->pos.x; x < rect->pos.x + rect->size.x; x++) {
|
for (int x = rect->pos.x; x < rect->pos.x + rect->size.x; x++) {
|
||||||
*CTX_BUF_PTR(ctx, x, y / 2) = color;
|
((ge_context_t*)render->context)->screen_buffer[y/2][x] = color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ge_context_t ge_context = {
|
||||||
|
.current_field = GE_RENDER_EVEN_LINES,
|
||||||
|
.head_canary = HEAD_CANARY,
|
||||||
|
.tail_canary = TAIL_CANARY,
|
||||||
|
};
|
||||||
|
|
||||||
ge_render_t ge_render = {
|
ge_render_t ge_render = {
|
||||||
.context = &ge_content,
|
.context = &ge_context,
|
||||||
.screen_size = {
|
.screen_size = {
|
||||||
.x = 128,
|
.x = SCREEN_WIDTH,
|
||||||
.y = 128,
|
.y = SCREEN_HEIGHT,
|
||||||
},
|
},
|
||||||
|
|
||||||
.init_func = init,
|
.init_func = init,
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include "ge_resource.h"
|
#include "ge_resource.h"
|
||||||
|
|
||||||
typedef int ge_render_unit_t;
|
typedef int ge_render_unit_t;
|
||||||
typedef int ge_render_color_t;
|
typedef uint16_t ge_render_color_t;
|
||||||
|
|
||||||
typedef struct ge_render_pos2 {
|
typedef struct ge_render_pos2 {
|
||||||
ge_render_unit_t x;
|
ge_render_unit_t x;
|
||||||
|
@ -1,115 +0,0 @@
|
|||||||
// #include "stm32f10x.h"
|
|
||||||
// #include "led.h"
|
|
||||||
// #include "usart.h"
|
|
||||||
// #include "delay.h"
|
|
||||||
// #include "button4_4.h"
|
|
||||||
#define __GE_INPUT_IMPLIMEMT__
|
|
||||||
#include "ge_mem_input.h"
|
|
||||||
struct IO_PORT
|
|
||||||
{
|
|
||||||
GPIO_TypeDef *GPIO_x;
|
|
||||||
unsigned short GPIO_pin;
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct IO_PORT KEY_OUT[4] = {
|
|
||||||
{KEY_H1_GPIO_Port, KEY_H1_Pin},
|
|
||||||
{KEY_H2_GPIO_Port, KEY_H2_Pin},
|
|
||||||
{KEY_H3_GPIO_Port, KEY_H3_Pin},
|
|
||||||
{KEY_H4_GPIO_Port, KEY_H4_Pin}
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct IO_PORT KEY_IN[4] = {
|
|
||||||
{KEY_L1_GPIO_Port, KEY_L1_Pin},
|
|
||||||
{KEY_L2_GPIO_Port, KEY_L2_Pin},
|
|
||||||
{KEY_L3_GPIO_Port, KEY_L3_Pin},
|
|
||||||
{KEY_L4_GPIO_Port, KEY_L4_Pin}
|
|
||||||
};
|
|
||||||
|
|
||||||
int key[4][4];
|
|
||||||
/*
|
|
||||||
void Button4_4_Init(void) {
|
|
||||||
GPIO_InitTypeDef GPIO_InitStructure;
|
|
||||||
unsigned char i;
|
|
||||||
|
|
||||||
RCC_APB2PeriphClockCmd(KEY_GPIO_CLK, ENABLE);
|
|
||||||
|
|
||||||
for(i = 0; i < 4; i++) {
|
|
||||||
GPIO_InitStructure.GPIO_Pin = KEY_OUT[i].GPIO_pin;
|
|
||||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
|
|
||||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
|
||||||
|
|
||||||
GPIO_Init(KEY_OUT[i].GPIO_x, &GPIO_InitStructure);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for(i = 0; i < 4; i++) {
|
|
||||||
GPIO_InitStructure.GPIO_Pin = KEY_IN[i].GPIO_pin;
|
|
||||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
|
|
||||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
|
||||||
|
|
||||||
GPIO_Init(KEY_IN[i].GPIO_x, &GPIO_InitStructure);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for(i = 0; i < 4; i++) {
|
|
||||||
GPIO_SetBits(KEY_OUT[i].GPIO_x, KEY_OUT[i].GPIO_pin);
|
|
||||||
}
|
|
||||||
|
|
||||||
for(i = 0; i < 4; i++) {
|
|
||||||
key[i][0] = 0;
|
|
||||||
key[i][1] = 0;
|
|
||||||
key[i][2] = 0;
|
|
||||||
key[i][3] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
//uint16_t key;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int Button4_4_Scan(void) {
|
|
||||||
unsigned char i, j;
|
|
||||||
|
|
||||||
for(i = 0; i < 4; i++) {
|
|
||||||
delay_ms(10);
|
|
||||||
GPIO_ResetBits(KEY_OUT[i].GPIO_x, KEY_OUT[i].GPIO_pin);
|
|
||||||
for(j = 0; j < 4; j++) {
|
|
||||||
|
|
||||||
delay_ms(10);
|
|
||||||
if(GPIO_ReadInputDataBit(KEY_IN[j].GPIO_x, KEY_IN[j].GPIO_pin) == 0){
|
|
||||||
|
|
||||||
key[i][j] = 1;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
key[i][j] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GPIO_SetBits(KEY_OUT[i].GPIO_x, KEY_OUT[i].GPIO_pin);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(key[0][0] == 1) return 16;
|
|
||||||
if(key[0][1] == 1) return 15;
|
|
||||||
if(key[0][2] == 1) return 14;
|
|
||||||
if(key[0][3] == 1) return 13;
|
|
||||||
|
|
||||||
if(key[1][0] == 1) return 12;
|
|
||||||
if(key[1][1] == 1) return 11;
|
|
||||||
if(key[1][2] == 1) return 10;
|
|
||||||
if(key[1][3] == 1) return 9;
|
|
||||||
|
|
||||||
if(key[2][0] == 1) return 8;
|
|
||||||
if(key[2][1] == 1) return 7;
|
|
||||||
if(key[2][2] == 1) return 6;
|
|
||||||
if(key[2][3] == 1) return 5;
|
|
||||||
|
|
||||||
if(key[3][0] == 1) return 4;
|
|
||||||
if(key[3][1] == 1) return 3;
|
|
||||||
if(key[3][2] == 1) return 2;
|
|
||||||
if(key[3][3] == 1) return 1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
|||||||
#ifndef __BUTTON4_4_H
|
|
||||||
#define __BUTTON4_4_H
|
|
||||||
|
|
||||||
#define KEY_GPIO_CLK RCC_APB2Periph_GPIOC
|
|
||||||
#define KEY_L1_Pin GPIO_Pin_0
|
|
||||||
#define KEY_L1_GPIO_Port GPIOC
|
|
||||||
#define KEY_L2_Pin GPIO_Pin_1
|
|
||||||
#define KEY_L2_GPIO_Port GPIOC
|
|
||||||
#define KEY_L3_Pin GPIO_Pin_2
|
|
||||||
#define KEY_L3_GPIO_Port GPIOC
|
|
||||||
#define KEY_L4_Pin GPIO_Pin_3
|
|
||||||
#define KEY_L4_GPIO_Port GPIOC
|
|
||||||
|
|
||||||
#define KEY_H1_Pin GPIO_Pin_4
|
|
||||||
#define KEY_H1_GPIO_Port GPIOC
|
|
||||||
#define KEY_H2_Pin GPIO_Pin_5
|
|
||||||
#define KEY_H2_GPIO_Port GPIOC
|
|
||||||
#define KEY_H3_Pin GPIO_Pin_6
|
|
||||||
#define KEY_H3_GPIO_Port GPIOC
|
|
||||||
#define KEY_H4_Pin GPIO_Pin_7
|
|
||||||
#define KEY_H4_GPIO_Port GPIOC
|
|
||||||
|
|
||||||
//#define BTN_GET_BIT(num, pos) ( (num) & ( 1 << (pos) ) )
|
|
||||||
//#define BTN_SET_TRUE(num, pos) ( (num) |= ( 1 << (pos) ) )
|
|
||||||
//#define BTN_SET_FALSE(num, pos) ( (num) &= ( ~( 1 << (pos) ) ) )
|
|
||||||
|
|
||||||
void Button4_4_Init(void);
|
|
||||||
int Button4_4_Scan(void);
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,25 +0,0 @@
|
|||||||
#ifndef __GE_MEM_INPUT_H__
|
|
||||||
#define __GE_MEM_INPUT_H__
|
|
||||||
|
|
||||||
#include <main.h>
|
|
||||||
#include <gpio.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include "../ge_interface.h"
|
|
||||||
int Button4_4_Scan(void);
|
|
||||||
|
|
||||||
#define delay_ms HAL_Delay
|
|
||||||
#define GPIO_ReadInputDataBit HAL_GPIO_ReadPin
|
|
||||||
#define GPIO_SetBits(port, pin) HAL_GPIO_WritePin(port, pin, 1)
|
|
||||||
#define GPIO_ResetBits(port, pin) HAL_GPIO_WritePin(port, pin, 0)
|
|
||||||
#ifdef __GE_INPUT_IMPLIMEMT__
|
|
||||||
|
|
||||||
void mem_input_btn_func(ge_input_t* ctx) {
|
|
||||||
uint16_t code = Button4_4_Scan();
|
|
||||||
ge_input_event_t event;
|
|
||||||
event.num = GE_ITYPE_KEY_L1H1 + code;
|
|
||||||
ctx->func_send(ctx, event);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
40
libs/uC-OS2/CMakeLists.txt
Normal file
40
libs/uC-OS2/CMakeLists.txt
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
# uC/OS-II RTOS integration for CMake
|
||||||
|
|
||||||
|
# 设置uC/OS-II的源代码路径
|
||||||
|
set(UCOS2_DIR ${CMAKE_SOURCE_DIR}/uC-OS2)
|
||||||
|
set(UCOS2_PORT_DIR ${UCOS2_DIR}/Ports/ARM-Cortex-M/ARMv6-M) # 根据您的MCU选择端口c
|
||||||
|
|
||||||
|
# 添加uC/OS-II的包含目录
|
||||||
|
include_directories(
|
||||||
|
${UCOS2_DIR}/Source
|
||||||
|
${UCOS2_PORT_DIR}/GNU
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}
|
||||||
|
${CMAKE_SOURCE_DIR}/Core/Inc
|
||||||
|
)
|
||||||
|
|
||||||
|
# 定义uC/OS-II的源文件
|
||||||
|
set(UCOS2_SOURCES
|
||||||
|
# ${UCOS2_DIR}/Source/os_core.c
|
||||||
|
# ${UCOS2_DIR}/Source/os_dbg_r.c
|
||||||
|
# ${UCOS2_DIR}/Source/os_flag.c
|
||||||
|
# ${UCOS2_DIR}/Source/os_mbox.c
|
||||||
|
# ${UCOS2_DIR}/Source/os_mem.c
|
||||||
|
# ${UCOS2_DIR}/Source/os_mutex.c
|
||||||
|
# ${UCOS2_DIR}/Source/os_q.c
|
||||||
|
# ${UCOS2_DIR}/Source/os_sem.c
|
||||||
|
# ${UCOS2_DIR}/Source/os_task.c
|
||||||
|
# ${UCOS2_DIR}/Source/os_time.c
|
||||||
|
# ${UCOS2_DIR}/Source/os_tmr.c
|
||||||
|
${UCOS2_DIR}/Source/ucos_ii.c
|
||||||
|
${UCOS2_PORT_DIR}/os_cpu_c.c
|
||||||
|
${UCOS2_PORT_DIR}/GNU/os_cpu_a.S
|
||||||
|
${UCOS2_PORT_DIR}/GNU/os_dbg.c
|
||||||
|
app_hooks.c
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(uCOS2 STATIC ${UCOS2_SOURCES})
|
||||||
|
target_include_directories(uCOS2 PUBLIC
|
||||||
|
${UCOS2_DIR}/Source
|
||||||
|
${UCOS2_PORT_DIR}/GNU
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}
|
||||||
|
)
|
102
libs/uC-OS2/app_cfg.h
Normal file
102
libs/uC-OS2/app_cfg.h
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* EXAMPLE CODE
|
||||||
|
*
|
||||||
|
* This file is provided as an example on how to use Micrium products.
|
||||||
|
*
|
||||||
|
* Please feel free to use any application code labeled as 'EXAMPLE CODE' in
|
||||||
|
* your application products. Example code may be used as is, in whole or in
|
||||||
|
* part, or may be used as a reference only. This file can be modified as
|
||||||
|
* required to meet the end-product requirements.
|
||||||
|
*
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
*
|
||||||
|
* APPLICATION CONFIGURATION
|
||||||
|
*
|
||||||
|
* EXAMPLE CODE
|
||||||
|
*
|
||||||
|
* Filename : app_cfg.h
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _APP_CFG_H_
|
||||||
|
#define _APP_CFG_H_
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* INCLUDE FILES
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* MODULE ENABLE / DISABLE
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* TASK PRIORITIES
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define APP_CFG_STARTUP_TASK_PRIO 3u
|
||||||
|
|
||||||
|
#define OS_TASK_TMR_PRIO (OS_LOWEST_PRIO - 2u)
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* TASK STACK SIZES
|
||||||
|
* Size of the task stacks (# of OS_STK entries)
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define APP_CFG_STARTUP_TASK_STK_SIZE 128u
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* TRACE / DEBUG CONFIGURATION
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef TRACE_LEVEL_OFF
|
||||||
|
#define TRACE_LEVEL_OFF 0u
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef TRACE_LEVEL_INFO
|
||||||
|
#define TRACE_LEVEL_INFO 1u
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef TRACE_LEVEL_DBG
|
||||||
|
#define TRACE_LEVEL_DBG 2u
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* ===== 中断优先级配置 ===== */
|
||||||
|
#define CPU_CFG_KA_IPL_BOUNDARY 0x0Fu /* 内核感知中断优先级阈值 */
|
||||||
|
#define CPU_CFG_NVIC_PRIO_BITS 4u /* NVIC优先级位数 */
|
||||||
|
|
||||||
|
#define APP_TRACE_LEVEL TRACE_LEVEL_OFF
|
||||||
|
#define APP_TRACE printf
|
||||||
|
|
||||||
|
#define APP_TRACE_INFO(x) ((APP_TRACE_LEVEL >= TRACE_LEVEL_INFO) ? (void)(APP_TRACE x) : (void)0)
|
||||||
|
#define APP_TRACE_DBG(x) ((APP_TRACE_LEVEL >= TRACE_LEVEL_DBG) ? (void)(APP_TRACE x) : (void)0)
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* MODULE END
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* End of module include. */
|
256
libs/uC-OS2/app_hooks.c
Normal file
256
libs/uC-OS2/app_hooks.c
Normal file
@ -0,0 +1,256 @@
|
|||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* EXAMPLE CODE
|
||||||
|
*
|
||||||
|
* This file is provided as an example on how to use Micrium products.
|
||||||
|
*
|
||||||
|
* Please feel free to use any application code labeled as 'EXAMPLE CODE' in
|
||||||
|
* your application products. Example code may be used as is, in whole or in
|
||||||
|
* part, or may be used as a reference only. This file can be modified as
|
||||||
|
* required to meet the end-product requirements.
|
||||||
|
*
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
*
|
||||||
|
* uC/OS-II
|
||||||
|
* Application Hooks
|
||||||
|
*
|
||||||
|
* Filename : app_hooks.c
|
||||||
|
* Version : V2.93.01
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* INCLUDE FILES
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <os.h>
|
||||||
|
#include "stm32f1xx_it.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* EXTERN GLOBAL VARIABLES
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* LOCAL CONSTANTS
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* LOCAL DATA TYPES
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* LOCAL TABLES
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* LOCAL GLOBAL VARIABLES
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* LOCAL FUNCTION PROTOTYPES
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
*********************************************************************************************************
|
||||||
|
** GLOBAL FUNCTIONS
|
||||||
|
*********************************************************************************************************
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
*********************************************************************************************************
|
||||||
|
** uC/OS-II APP HOOKS
|
||||||
|
*********************************************************************************************************
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if (OS_APP_HOOKS_EN > 0)
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* TASK CREATION HOOK (APPLICATION)
|
||||||
|
*
|
||||||
|
* Description : This function is called when a task is created.
|
||||||
|
*
|
||||||
|
* Argument(s) : ptcb is a pointer to the task control block of the task being created.
|
||||||
|
*
|
||||||
|
* Note(s) : (1) Interrupts are disabled during this call.
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
void App_TaskCreateHook (OS_TCB *ptcb)
|
||||||
|
{
|
||||||
|
(void)ptcb;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* TASK DELETION HOOK (APPLICATION)
|
||||||
|
*
|
||||||
|
* Description : This function is called when a task is deleted.
|
||||||
|
*
|
||||||
|
* Argument(s) : ptcb is a pointer to the task control block of the task being deleted.
|
||||||
|
*
|
||||||
|
* Note(s) : (1) Interrupts are disabled during this call.
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
void App_TaskDelHook (OS_TCB *ptcb)
|
||||||
|
{
|
||||||
|
(void)ptcb;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* IDLE TASK HOOK (APPLICATION)
|
||||||
|
*
|
||||||
|
* Description : This function is called by OSTaskIdleHook(), which is called by the idle task. This hook
|
||||||
|
* has been added to allow you to do such things as STOP the CPU to conserve power.
|
||||||
|
*
|
||||||
|
* Argument(s) : none.
|
||||||
|
*
|
||||||
|
* Note(s) : (1) Interrupts are enabled during this call.
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if OS_VERSION >= 251
|
||||||
|
void App_TaskIdleHook (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* STATISTIC TASK HOOK (APPLICATION)
|
||||||
|
*
|
||||||
|
* Description : This function is called by OSTaskStatHook(), which is called every second by uC/OS-II's
|
||||||
|
* statistics task. This allows your application to add functionality to the statistics task.
|
||||||
|
*
|
||||||
|
* Argument(s) : none.
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
void App_TaskStatHook (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* TASK RETURN HOOK (APPLICATION)
|
||||||
|
*
|
||||||
|
* Description: This function is called if a task accidentally returns. In other words, a task should
|
||||||
|
* either be an infinite loop or delete itself when done.
|
||||||
|
*
|
||||||
|
* Arguments : ptcb is a pointer to the task control block of the task that is returning.
|
||||||
|
*
|
||||||
|
* Note(s) : none
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#if OS_VERSION >= 289
|
||||||
|
void App_TaskReturnHook (OS_TCB *ptcb)
|
||||||
|
{
|
||||||
|
(void)ptcb;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* TASK SWITCH HOOK (APPLICATION)
|
||||||
|
*
|
||||||
|
* Description : This function is called when a task switch is performed. This allows you to perform other
|
||||||
|
* operations during a context switch.
|
||||||
|
*
|
||||||
|
* Argument(s) : none.
|
||||||
|
*
|
||||||
|
* Note(s) : (1) Interrupts are disabled during this call.
|
||||||
|
*
|
||||||
|
* (2) It is assumed that the global pointer 'OSTCBHighRdy' points to the TCB of the task that
|
||||||
|
* will be 'switched in' (i.e. the highest priority task) and, 'OSTCBCur' points to the
|
||||||
|
* task being switched out (i.e. the preempted task).
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if OS_TASK_SW_HOOK_EN > 0
|
||||||
|
void App_TaskSwHook (void)
|
||||||
|
{
|
||||||
|
PendSV_Handler();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* OS_TCBInit() HOOK (APPLICATION)
|
||||||
|
*
|
||||||
|
* Description : This function is called by OSTCBInitHook(), which is called by OS_TCBInit() after setting
|
||||||
|
* up most of the TCB.
|
||||||
|
*
|
||||||
|
* Argument(s) : ptcb is a pointer to the TCB of the task being created.
|
||||||
|
*
|
||||||
|
* Note(s) : (1) Interrupts may or may not be ENABLED during this call.
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if OS_VERSION >= 204
|
||||||
|
void App_TCBInitHook (OS_TCB *ptcb)
|
||||||
|
{
|
||||||
|
(void)ptcb;
|
||||||
|
if (ptcb->OSTCBExtPtr != 0) {
|
||||||
|
ptcb->OSTCBTaskName = (unsigned char*)ptcb->OSTCBExtPtr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* TICK HOOK (APPLICATION)
|
||||||
|
*
|
||||||
|
* Description : This function is called every tick.
|
||||||
|
*
|
||||||
|
* Argument(s) : none.
|
||||||
|
*
|
||||||
|
* Note(s) : (1) Interrupts may or may not be ENABLED during this call.
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if OS_TIME_TICK_HOOK_EN > 0
|
||||||
|
void App_TimeTickHook (void)
|
||||||
|
{
|
||||||
|
SysTick_Handler();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
154
libs/uC-OS2/os_cfg.h
Normal file
154
libs/uC-OS2/os_cfg.h
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
* uC/OS-II
|
||||||
|
* The Real-Time Kernel
|
||||||
|
*
|
||||||
|
* Copyright 1992-2021 Silicon Laboratories Inc. www.silabs.com
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: APACHE-2.0
|
||||||
|
*
|
||||||
|
* This software is subject to an open source license and is distributed by
|
||||||
|
* Silicon Laboratories Inc. pursuant to the terms of the Apache License,
|
||||||
|
* Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
|
||||||
|
*
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*********************************************************************************************************
|
||||||
|
*
|
||||||
|
* uC/OS-II Configuration File for V2.9x
|
||||||
|
*
|
||||||
|
* Filename : os_cfg.h
|
||||||
|
* Version : V2.93.01
|
||||||
|
*********************************************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef OS_CFG_H
|
||||||
|
#define OS_CFG_H
|
||||||
|
|
||||||
|
|
||||||
|
/* ---------------------- MISCELLANEOUS ----------------------- */
|
||||||
|
#define OS_APP_HOOKS_EN 1u /* Application-defined hooks are called from the uC/OS-II hooks */
|
||||||
|
#define OS_ARG_CHK_EN 1u /* Enable (1) or Disable (0) argument checking */
|
||||||
|
#define OS_CPU_HOOKS_EN 1u /* uC/OS-II hooks are found in the processor port files */
|
||||||
|
|
||||||
|
#define OS_DEBUG_EN 1u /* Enable(1) debug variables */
|
||||||
|
|
||||||
|
#define OS_EVENT_MULTI_EN 1u /* Include code for OSEventPendMulti() */
|
||||||
|
#define OS_EVENT_NAME_EN 1u /* Enable names for Sem, Mutex, Mbox and Q */
|
||||||
|
|
||||||
|
#define OS_LOWEST_PRIO 63u /* Defines the lowest priority that can be assigned ... */
|
||||||
|
/* ... MUST NEVER be higher than 254! */
|
||||||
|
|
||||||
|
#define OS_MAX_EVENTS 10u /* Max. number of event control blocks in your application */
|
||||||
|
#define OS_MAX_FLAGS 5u /* Max. number of Event Flag Groups in your application */
|
||||||
|
#define OS_MAX_MEM_PART 5u /* Max. number of memory partitions */
|
||||||
|
#define OS_MAX_QS 4u /* Max. number of queue control blocks in your application */
|
||||||
|
#define OS_MAX_TASKS 20u /* Max. number of tasks in your application, MUST be >= 2 */
|
||||||
|
|
||||||
|
#define OS_SCHED_LOCK_EN 1u /* Include code for OSSchedLock() and OSSchedUnlock() */
|
||||||
|
|
||||||
|
#define OS_TICK_STEP_EN 1u /* Enable tick stepping feature for uC/OS-View */
|
||||||
|
#define OS_TICKS_PER_SEC 1000u /* Set the number of ticks in one second */
|
||||||
|
|
||||||
|
#define OS_TLS_TBL_SIZE 0u /* Size of Thread-Local Storage Table */
|
||||||
|
|
||||||
|
|
||||||
|
/* --------------------- TASK STACK SIZE ---------------------- */
|
||||||
|
#define OS_TASK_TMR_STK_SIZE 128u /* Timer task stack size (# of OS_STK wide entries) */
|
||||||
|
#define OS_TASK_STAT_STK_SIZE 128u /* Statistics task stack size (# of OS_STK wide entries) */
|
||||||
|
#define OS_TASK_IDLE_STK_SIZE 128u /* Idle task stack size (# of OS_STK wide entries) */
|
||||||
|
|
||||||
|
|
||||||
|
/* --------------------- TASK MANAGEMENT ---------------------- */
|
||||||
|
#define OS_TASK_CHANGE_PRIO_EN 1u /* Include code for OSTaskChangePrio() */
|
||||||
|
#define OS_TASK_CREATE_EN 1u /* Include code for OSTaskCreate() */
|
||||||
|
#define OS_TASK_CREATE_EXT_EN 1u /* Include code for OSTaskCreateExt() */
|
||||||
|
#define OS_TASK_DEL_EN 1u /* Include code for OSTaskDel() */
|
||||||
|
#define OS_TASK_NAME_EN 1u /* Enable task names */
|
||||||
|
#define OS_TASK_PROFILE_EN 1u /* Include variables in OS_TCB for profiling */
|
||||||
|
#define OS_TASK_QUERY_EN 1u /* Include code for OSTaskQuery() */
|
||||||
|
#define OS_TASK_REG_TBL_SIZE 1u /* Size of task variables array (#of INT32U entries) */
|
||||||
|
#define OS_TASK_STAT_EN 1u /* Enable (1) or Disable(0) the statistics task */
|
||||||
|
#define OS_TASK_STAT_STK_CHK_EN 1u /* Check task stacks from statistic task */
|
||||||
|
#define OS_TASK_SUSPEND_EN 1u /* Include code for OSTaskSuspend() and OSTaskResume() */
|
||||||
|
#define OS_TASK_SW_HOOK_EN 1u /* Include code for OSTaskSwHook() */
|
||||||
|
|
||||||
|
|
||||||
|
/* ----------------------- EVENT FLAGS ------------------------ */
|
||||||
|
#define OS_FLAG_EN 0u /* Enable (1) or Disable (0) code generation for EVENT FLAGS */
|
||||||
|
#define OS_FLAG_ACCEPT_EN 1u /* Include code for OSFlagAccept() */
|
||||||
|
#define OS_FLAG_DEL_EN 1u /* Include code for OSFlagDel() */
|
||||||
|
#define OS_FLAG_NAME_EN 1u /* Enable names for event flag group */
|
||||||
|
#define OS_FLAG_QUERY_EN 1u /* Include code for OSFlagQuery() */
|
||||||
|
#define OS_FLAG_WAIT_CLR_EN 1u /* Include code for Wait on Clear EVENT FLAGS */
|
||||||
|
#define OS_FLAGS_NBITS 16u /* Size in #bits of OS_FLAGS data type (8, 16 or 32) */
|
||||||
|
|
||||||
|
|
||||||
|
/* -------------------- MESSAGE MAILBOXES --------------------- */
|
||||||
|
#define OS_MBOX_EN 0u /* Enable (1) or Disable (0) code generation for MAILBOXES */
|
||||||
|
#define OS_MBOX_ACCEPT_EN 1u /* Include code for OSMboxAccept() */
|
||||||
|
#define OS_MBOX_DEL_EN 1u /* Include code for OSMboxDel() */
|
||||||
|
#define OS_MBOX_PEND_ABORT_EN 1u /* Include code for OSMboxPendAbort() */
|
||||||
|
#define OS_MBOX_POST_EN 1u /* Include code for OSMboxPost() */
|
||||||
|
#define OS_MBOX_POST_OPT_EN 1u /* Include code for OSMboxPostOpt() */
|
||||||
|
#define OS_MBOX_QUERY_EN 1u /* Include code for OSMboxQuery() */
|
||||||
|
|
||||||
|
|
||||||
|
/* --------------------- MEMORY MANAGEMENT -------------------- */
|
||||||
|
#define OS_MEM_EN 0u /* Enable (1) or Disable (0) code generation for MEMORY MANAGER */
|
||||||
|
#define OS_MEM_NAME_EN 1u /* Enable memory partition names */
|
||||||
|
#define OS_MEM_QUERY_EN 1u /* Include code for OSMemQuery() */
|
||||||
|
|
||||||
|
|
||||||
|
/* ---------------- MUTUAL EXCLUSION SEMAPHORES --------------- */
|
||||||
|
#define OS_MUTEX_EN 0u /* Enable (1) or Disable (0) code generation for MUTEX */
|
||||||
|
#define OS_MUTEX_ACCEPT_EN 1u /* Include code for OSMutexAccept() */
|
||||||
|
#define OS_MUTEX_DEL_EN 1u /* Include code for OSMutexDel() */
|
||||||
|
#define OS_MUTEX_QUERY_EN 1u /* Include code for OSMutexQuery() */
|
||||||
|
|
||||||
|
|
||||||
|
/* ---------------------- MESSAGE QUEUES ---------------------- */
|
||||||
|
#define OS_Q_EN 0u /* Enable (1) or Disable (0) code generation for QUEUES */
|
||||||
|
#define OS_Q_ACCEPT_EN 1u /* Include code for OSQAccept() */
|
||||||
|
#define OS_Q_DEL_EN 1u /* Include code for OSQDel() */
|
||||||
|
#define OS_Q_FLUSH_EN 1u /* Include code for OSQFlush() */
|
||||||
|
#define OS_Q_PEND_ABORT_EN 1u /* Include code for OSQPendAbort() */
|
||||||
|
#define OS_Q_POST_EN 1u /* Include code for OSQPost() */
|
||||||
|
#define OS_Q_POST_FRONT_EN 1u /* Include code for OSQPostFront() */
|
||||||
|
#define OS_Q_POST_OPT_EN 1u /* Include code for OSQPostOpt() */
|
||||||
|
#define OS_Q_QUERY_EN 1u /* Include code for OSQQuery() */
|
||||||
|
|
||||||
|
|
||||||
|
/* ------------------------ SEMAPHORES ------------------------ */
|
||||||
|
#define OS_SEM_EN 1u /* Enable (1) or Disable (0) code generation for SEMAPHORES */
|
||||||
|
#define OS_SEM_ACCEPT_EN 1u /* Include code for OSSemAccept() */
|
||||||
|
#define OS_SEM_DEL_EN 1u /* Include code for OSSemDel() */
|
||||||
|
#define OS_SEM_PEND_ABORT_EN 1u /* Include code for OSSemPendAbort() */
|
||||||
|
#define OS_SEM_QUERY_EN 1u /* Include code for OSSemQuery() */
|
||||||
|
#define OS_SEM_SET_EN 1u /* Include code for OSSemSet() */
|
||||||
|
|
||||||
|
|
||||||
|
/* --------------------- TIME MANAGEMENT ---------------------- */
|
||||||
|
#define OS_TIME_DLY_HMSM_EN 1u /* Include code for OSTimeDlyHMSM() */
|
||||||
|
#define OS_TIME_DLY_RESUME_EN 1u /* Include code for OSTimeDlyResume() */
|
||||||
|
#define OS_TIME_GET_SET_EN 1u /* Include code for OSTimeGet() and OSTimeSet() */
|
||||||
|
#define OS_TIME_TICK_HOOK_EN 1u /* Include code for OSTimeTickHook() */
|
||||||
|
|
||||||
|
|
||||||
|
/* --------------------- TIMER MANAGEMENT --------------------- */
|
||||||
|
#define OS_TMR_EN 1u /* Enable (1) or Disable (0) code generation for TIMERS */
|
||||||
|
#define OS_TMR_CFG_MAX 16u /* Maximum number of timers */
|
||||||
|
#define OS_TMR_CFG_NAME_EN 1u /* Determine timer names */
|
||||||
|
#define OS_TMR_CFG_WHEEL_SIZE 7u /* Size of timer wheel (#Spokes) */
|
||||||
|
#define OS_TMR_CFG_TICKS_PER_SEC 10u /* Rate at which timer management task runs (Hz) */
|
||||||
|
|
||||||
|
|
||||||
|
/* ---------------------- TRACE RECORDER ---------------------- */
|
||||||
|
#define OS_TRACE_EN 0u /* Enable (1) or Disable (0) uC/OS-II Trace instrumentation */
|
||||||
|
#define OS_TRACE_API_ENTER_EN 0u /* Enable (1) or Disable (0) uC/OS-II Trace API enter instrum. */
|
||||||
|
#define OS_TRACE_API_EXIT_EN 0u /* Enable (1) or Disable (0) uC/OS-II Trace API exit instrum. */
|
||||||
|
|
||||||
|
#endif
|
475
startup_stm32f103xe.s
Normal file
475
startup_stm32f103xe.s
Normal file
@ -0,0 +1,475 @@
|
|||||||
|
/**
|
||||||
|
*************** (C) COPYRIGHT 2017 STMicroelectronics ************************
|
||||||
|
* @file startup_stm32f103xe.s
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief STM32F103xE Devices vector table for Atollic toolchain.
|
||||||
|
* This module performs:
|
||||||
|
* - Set the initial SP
|
||||||
|
* - Set the initial PC == Reset_Handler,
|
||||||
|
* - Set the vector table entries with the exceptions ISR address
|
||||||
|
* - Configure the clock system
|
||||||
|
* - Configure external SRAM mounted on STM3210E-EVAL board
|
||||||
|
* to be used as data memory (optional, to be enabled by user)
|
||||||
|
* - Branches to main in the C library (which eventually
|
||||||
|
* calls main()).
|
||||||
|
* After Reset the Cortex-M3 processor is in Thread mode,
|
||||||
|
* priority is Privileged, and the Stack is set to Main.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017-2021 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
.syntax unified
|
||||||
|
.cpu cortex-m3
|
||||||
|
.fpu softvfp
|
||||||
|
.thumb
|
||||||
|
|
||||||
|
.global g_pfnVectors
|
||||||
|
.global Default_Handler
|
||||||
|
|
||||||
|
/* start address for the initialization values of the .data section.
|
||||||
|
defined in linker script */
|
||||||
|
.word _sidata
|
||||||
|
/* start address for the .data section. defined in linker script */
|
||||||
|
.word _sdata
|
||||||
|
/* end address for the .data section. defined in linker script */
|
||||||
|
.word _edata
|
||||||
|
/* start address for the .bss section. defined in linker script */
|
||||||
|
.word _sbss
|
||||||
|
/* end address for the .bss section. defined in linker script */
|
||||||
|
.word _ebss
|
||||||
|
|
||||||
|
.equ BootRAM, 0xF1E0F85F
|
||||||
|
/**
|
||||||
|
* @brief This is the code that gets called when the processor first
|
||||||
|
* starts execution following a reset event. Only the absolutely
|
||||||
|
* necessary set is performed, after which the application
|
||||||
|
* supplied main() routine is called.
|
||||||
|
* @param None
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
|
||||||
|
.section .text.Reset_Handler
|
||||||
|
.weak Reset_Handler
|
||||||
|
.type Reset_Handler, %function
|
||||||
|
Reset_Handler:
|
||||||
|
|
||||||
|
/* Call the clock system initialization function.*/
|
||||||
|
bl SystemInit
|
||||||
|
|
||||||
|
/* Copy the data segment initializers from flash to SRAM */
|
||||||
|
ldr r0, =_sdata
|
||||||
|
ldr r1, =_edata
|
||||||
|
ldr r2, =_sidata
|
||||||
|
movs r3, #0
|
||||||
|
b LoopCopyDataInit
|
||||||
|
|
||||||
|
CopyDataInit:
|
||||||
|
ldr r4, [r2, r3]
|
||||||
|
str r4, [r0, r3]
|
||||||
|
adds r3, r3, #4
|
||||||
|
|
||||||
|
LoopCopyDataInit:
|
||||||
|
adds r4, r0, r3
|
||||||
|
cmp r4, r1
|
||||||
|
bcc CopyDataInit
|
||||||
|
|
||||||
|
/* Zero fill the bss segment. */
|
||||||
|
ldr r2, =_sbss
|
||||||
|
ldr r4, =_ebss
|
||||||
|
movs r3, #0
|
||||||
|
b LoopFillZerobss
|
||||||
|
|
||||||
|
FillZerobss:
|
||||||
|
str r3, [r2]
|
||||||
|
adds r2, r2, #4
|
||||||
|
|
||||||
|
LoopFillZerobss:
|
||||||
|
cmp r2, r4
|
||||||
|
bcc FillZerobss
|
||||||
|
|
||||||
|
/* Call static constructors */
|
||||||
|
bl __libc_init_array
|
||||||
|
/* Call the application's entry point.*/
|
||||||
|
bl main
|
||||||
|
bx lr
|
||||||
|
.size Reset_Handler, .-Reset_Handler
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This is the code that gets called when the processor receives an
|
||||||
|
* unexpected interrupt. This simply enters an infinite loop, preserving
|
||||||
|
* the system state for examination by a debugger.
|
||||||
|
*
|
||||||
|
* @param None
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
.section .text.Default_Handler,"ax",%progbits
|
||||||
|
Default_Handler:
|
||||||
|
Infinite_Loop:
|
||||||
|
b Infinite_Loop
|
||||||
|
.size Default_Handler, .-Default_Handler
|
||||||
|
/******************************************************************************
|
||||||
|
*
|
||||||
|
* The minimal vector table for a Cortex M3. Note that the proper constructs
|
||||||
|
* must be placed on this to ensure that it ends up at physical address
|
||||||
|
* 0x0000.0000.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
.section .isr_vector,"a",%progbits
|
||||||
|
.type g_pfnVectors, %object
|
||||||
|
.size g_pfnVectors, .-g_pfnVectors
|
||||||
|
|
||||||
|
|
||||||
|
g_pfnVectors:
|
||||||
|
|
||||||
|
.word _estack
|
||||||
|
.word Reset_Handler
|
||||||
|
.word NMI_Handler
|
||||||
|
.word HardFault_Handler
|
||||||
|
.word MemManage_Handler
|
||||||
|
.word BusFault_Handler
|
||||||
|
.word UsageFault_Handler
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word SVC_Handler
|
||||||
|
.word DebugMon_Handler
|
||||||
|
.word 0
|
||||||
|
#ifdef __USE_UCOS2__
|
||||||
|
.word OS_CPU_PendSVHandler
|
||||||
|
.word OS_CPU_SysTickHandler
|
||||||
|
#else
|
||||||
|
.word PendSV_Handler
|
||||||
|
.word SysTick_Handler
|
||||||
|
#endif
|
||||||
|
.word WWDG_IRQHandler
|
||||||
|
.word PVD_IRQHandler
|
||||||
|
.word TAMPER_IRQHandler
|
||||||
|
.word RTC_IRQHandler
|
||||||
|
.word FLASH_IRQHandler
|
||||||
|
.word RCC_IRQHandler
|
||||||
|
.word EXTI0_IRQHandler
|
||||||
|
.word EXTI1_IRQHandler
|
||||||
|
.word EXTI2_IRQHandler
|
||||||
|
.word EXTI3_IRQHandler
|
||||||
|
.word EXTI4_IRQHandler
|
||||||
|
.word DMA1_Channel1_IRQHandler
|
||||||
|
.word DMA1_Channel2_IRQHandler
|
||||||
|
.word DMA1_Channel3_IRQHandler
|
||||||
|
.word DMA1_Channel4_IRQHandler
|
||||||
|
.word DMA1_Channel5_IRQHandler
|
||||||
|
.word DMA1_Channel6_IRQHandler
|
||||||
|
.word DMA1_Channel7_IRQHandler
|
||||||
|
.word ADC1_2_IRQHandler
|
||||||
|
.word USB_HP_CAN1_TX_IRQHandler
|
||||||
|
.word USB_LP_CAN1_RX0_IRQHandler
|
||||||
|
.word CAN1_RX1_IRQHandler
|
||||||
|
.word CAN1_SCE_IRQHandler
|
||||||
|
.word EXTI9_5_IRQHandler
|
||||||
|
.word TIM1_BRK_IRQHandler
|
||||||
|
.word TIM1_UP_IRQHandler
|
||||||
|
.word TIM1_TRG_COM_IRQHandler
|
||||||
|
.word TIM1_CC_IRQHandler
|
||||||
|
.word TIM2_IRQHandler
|
||||||
|
.word TIM3_IRQHandler
|
||||||
|
.word TIM4_IRQHandler
|
||||||
|
.word I2C1_EV_IRQHandler
|
||||||
|
.word I2C1_ER_IRQHandler
|
||||||
|
.word I2C2_EV_IRQHandler
|
||||||
|
.word I2C2_ER_IRQHandler
|
||||||
|
.word SPI1_IRQHandler
|
||||||
|
.word SPI2_IRQHandler
|
||||||
|
.word USART1_IRQHandler
|
||||||
|
.word USART2_IRQHandler
|
||||||
|
.word USART3_IRQHandler
|
||||||
|
.word EXTI15_10_IRQHandler
|
||||||
|
.word RTC_Alarm_IRQHandler
|
||||||
|
.word USBWakeUp_IRQHandler
|
||||||
|
.word TIM8_BRK_IRQHandler
|
||||||
|
.word TIM8_UP_IRQHandler
|
||||||
|
.word TIM8_TRG_COM_IRQHandler
|
||||||
|
.word TIM8_CC_IRQHandler
|
||||||
|
.word ADC3_IRQHandler
|
||||||
|
.word FSMC_IRQHandler
|
||||||
|
.word SDIO_IRQHandler
|
||||||
|
.word TIM5_IRQHandler
|
||||||
|
.word SPI3_IRQHandler
|
||||||
|
.word UART4_IRQHandler
|
||||||
|
.word UART5_IRQHandler
|
||||||
|
.word TIM6_IRQHandler
|
||||||
|
.word TIM7_IRQHandler
|
||||||
|
.word DMA2_Channel1_IRQHandler
|
||||||
|
.word DMA2_Channel2_IRQHandler
|
||||||
|
.word DMA2_Channel3_IRQHandler
|
||||||
|
.word DMA2_Channel4_5_IRQHandler
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word BootRAM /* @0x1E0. This is for boot in RAM mode for
|
||||||
|
STM32F10x High Density devices. */
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* Provide weak aliases for each Exception handler to the Default_Handler.
|
||||||
|
* As they are weak aliases, any function with the same name will override
|
||||||
|
* this definition.
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
.weak NMI_Handler
|
||||||
|
.thumb_set NMI_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak HardFault_Handler
|
||||||
|
.thumb_set HardFault_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak MemManage_Handler
|
||||||
|
.thumb_set MemManage_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak BusFault_Handler
|
||||||
|
.thumb_set BusFault_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak UsageFault_Handler
|
||||||
|
.thumb_set UsageFault_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak SVC_Handler
|
||||||
|
.thumb_set SVC_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak DebugMon_Handler
|
||||||
|
.thumb_set DebugMon_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak PendSV_Handler
|
||||||
|
.thumb_set PendSV_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak SysTick_Handler
|
||||||
|
.thumb_set SysTick_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak WWDG_IRQHandler
|
||||||
|
.thumb_set WWDG_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak PVD_IRQHandler
|
||||||
|
.thumb_set PVD_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TAMPER_IRQHandler
|
||||||
|
.thumb_set TAMPER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RTC_IRQHandler
|
||||||
|
.thumb_set RTC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FLASH_IRQHandler
|
||||||
|
.thumb_set FLASH_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RCC_IRQHandler
|
||||||
|
.thumb_set RCC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI0_IRQHandler
|
||||||
|
.thumb_set EXTI0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI1_IRQHandler
|
||||||
|
.thumb_set EXTI1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI2_IRQHandler
|
||||||
|
.thumb_set EXTI2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI3_IRQHandler
|
||||||
|
.thumb_set EXTI3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI4_IRQHandler
|
||||||
|
.thumb_set EXTI4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel1_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel2_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel3_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel4_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel5_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel6_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel6_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel7_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel7_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak ADC1_2_IRQHandler
|
||||||
|
.thumb_set ADC1_2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USB_HP_CAN1_TX_IRQHandler
|
||||||
|
.thumb_set USB_HP_CAN1_TX_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USB_LP_CAN1_RX0_IRQHandler
|
||||||
|
.thumb_set USB_LP_CAN1_RX0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak CAN1_RX1_IRQHandler
|
||||||
|
.thumb_set CAN1_RX1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak CAN1_SCE_IRQHandler
|
||||||
|
.thumb_set CAN1_SCE_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI9_5_IRQHandler
|
||||||
|
.thumb_set EXTI9_5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_BRK_IRQHandler
|
||||||
|
.thumb_set TIM1_BRK_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_UP_IRQHandler
|
||||||
|
.thumb_set TIM1_UP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_TRG_COM_IRQHandler
|
||||||
|
.thumb_set TIM1_TRG_COM_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_CC_IRQHandler
|
||||||
|
.thumb_set TIM1_CC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM2_IRQHandler
|
||||||
|
.thumb_set TIM2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM3_IRQHandler
|
||||||
|
.thumb_set TIM3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM4_IRQHandler
|
||||||
|
.thumb_set TIM4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C1_EV_IRQHandler
|
||||||
|
.thumb_set I2C1_EV_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C1_ER_IRQHandler
|
||||||
|
.thumb_set I2C1_ER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C2_EV_IRQHandler
|
||||||
|
.thumb_set I2C2_EV_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C2_ER_IRQHandler
|
||||||
|
.thumb_set I2C2_ER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI1_IRQHandler
|
||||||
|
.thumb_set SPI1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI2_IRQHandler
|
||||||
|
.thumb_set SPI2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USART1_IRQHandler
|
||||||
|
.thumb_set USART1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USART2_IRQHandler
|
||||||
|
.thumb_set USART2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USART3_IRQHandler
|
||||||
|
.thumb_set USART3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI15_10_IRQHandler
|
||||||
|
.thumb_set EXTI15_10_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RTC_Alarm_IRQHandler
|
||||||
|
.thumb_set RTC_Alarm_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USBWakeUp_IRQHandler
|
||||||
|
.thumb_set USBWakeUp_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_BRK_IRQHandler
|
||||||
|
.thumb_set TIM8_BRK_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_UP_IRQHandler
|
||||||
|
.thumb_set TIM8_UP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_TRG_COM_IRQHandler
|
||||||
|
.thumb_set TIM8_TRG_COM_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_CC_IRQHandler
|
||||||
|
.thumb_set TIM8_CC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak ADC3_IRQHandler
|
||||||
|
.thumb_set ADC3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FSMC_IRQHandler
|
||||||
|
.thumb_set FSMC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SDIO_IRQHandler
|
||||||
|
.thumb_set SDIO_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM5_IRQHandler
|
||||||
|
.thumb_set TIM5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI3_IRQHandler
|
||||||
|
.thumb_set SPI3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak UART4_IRQHandler
|
||||||
|
.thumb_set UART4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak UART5_IRQHandler
|
||||||
|
.thumb_set UART5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM6_IRQHandler
|
||||||
|
.thumb_set TIM6_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM7_IRQHandler
|
||||||
|
.thumb_set TIM7_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel1_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel2_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel3_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel4_5_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel4_5_IRQHandler,Default_Handler
|
||||||
|
|
Reference in New Issue
Block a user