Добавлена поддержка FreeRTOS #16

Merged
klassents merged 23 commits from v0.5.0_FreeRTOS into v0.5.0 2025-03-28 06:37:51 +03:00
3 changed files with 7 additions and 8 deletions
Showing only changes of commit 2a32262053 - Show all commits

View File

@ -112,11 +112,9 @@ SystemInit:
.section .trap_text, "ax"
// .org should be consistent with
// default mtvec value (set in scr1_arch_description.svh)
//.org 0xC0
//.org 0xC0 //j raw_trap_handler
trap_entry:
// j raw_trap_handler
la t0, freertos_risc_v_trap_handler
jalr t0
j freertos_risc_v_trap_handler
raw_trap_handler:
// Save registers

View File

@ -47,8 +47,8 @@ extern "C" {
/* Set the stack depth type to be uint16_t, otherwise it defaults to StackType_t */
#define configSTACK_DEPTH_TYPE uint16_t
#define configMINIMAL_STACK_SIZE 192
#define configISR_STACK_SIZE_WORDS 128 // todo сколько надо?
#define configMINIMAL_STACK_SIZE 256
// #define configISR_STACK_SIZE_WORDS 128 // todo сколько надо?
#define configCHECK_FOR_STACK_OVERFLOW 1
#define configUSE_TRACE_FACILITY 0

View File

@ -116,7 +116,7 @@ definitions. */
add t2, a3, t1 /* Add overflow to high word of ullNextTime. */
sw a4, 0(a1) /* Store new low word of ullNextTime. */
sw t2, 4(a1) /* Store new high word of ullNextTime. */
#endif /* __riscv_xlen == 32 */
#if( __riscv_xlen == 64 )
@ -326,7 +326,7 @@ exit_without_context_switch:
portcontextRESTORE_CONTEXT
/*-----------------------------------------------------------*/
.section .text.freertos_risc_v_trap_handler
.section .ram_text
.align 8
freertos_risc_v_trap_handler:
portcontextSAVE_CONTEXT_INTERNAL
@ -357,6 +357,7 @@ handle_interrupt:
bne a0, t1, application_interrupt_handler
portUPDATE_MTIMER_COMPARE_REGISTER
call toggleTestPin
call xTaskIncrementTick
beqz a0, processed_source /* Don't switch context if incrementing tick didn't unblock a task. */
call vTaskSwitchContext