mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-12-08 12:45:22 -05:00
Set the mtvec register in the Spike demonstraction (#794)
* Set the mtvec register to freertos_risc_v_trap_handler
This commit is contained in:
parent
cc8c0266a8
commit
9abd84992b
1 changed files with 13 additions and 0 deletions
|
|
@ -31,11 +31,18 @@
|
|||
/* Run a simple demo just prints 'Blink' */
|
||||
#define DEMO_BLINKY 1
|
||||
|
||||
extern void freertos_risc_v_trap_handler( void );
|
||||
|
||||
void vApplicationMallocFailedHook( void );
|
||||
void vApplicationIdleHook( void );
|
||||
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName );
|
||||
void vApplicationTickHook( void );
|
||||
|
||||
/*
|
||||
* Setup the Spike simulator to run this demo.
|
||||
*/
|
||||
static void prvSetupSpike( void );
|
||||
|
||||
int main_blinky( void );
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
@ -43,6 +50,7 @@ int main_blinky( void );
|
|||
int main( void )
|
||||
{
|
||||
int ret;
|
||||
prvSetupSpike();
|
||||
|
||||
#if defined(DEMO_BLINKY)
|
||||
ret = main_blinky();
|
||||
|
|
@ -52,6 +60,11 @@ int main( void )
|
|||
|
||||
return ret;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
static void prvSetupSpike( void )
|
||||
{
|
||||
__asm__ volatile( "csrw mtvec, %0" :: "r"( freertos_risc_v_trap_handler ) );
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue