OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [sw/] [example/] [demo_freeRTOS/] [main.c] - Diff between revs 60 and 65

Show entire file | Details | Blame | View Log

Rev 60 Rev 65
Line 104... Line 104...
int main( void )
int main( void )
{
{
        prvSetupHardware();
        prvSetupHardware();
 
 
  /* say hi */
  /* say hi */
  neorv32_uart_printf("FreeRTOS %s on NEORV32 Demo\n\n", tskKERNEL_VERSION_NUMBER);
  neorv32_uart0_printf("FreeRTOS %s on NEORV32 Demo\n\n", tskKERNEL_VERSION_NUMBER);
 
 
        /* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top
        /* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top
        of this file. */
        of this file. */
#if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 )
#if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 )
  main_blinky();
  main_blinky();
Line 126... Line 126...
 
 
  // clear GPIO.out port
  // clear GPIO.out port
  neorv32_gpio_port_set(0);
  neorv32_gpio_port_set(0);
 
 
  // init UART at default baud rate, no parity bits, ho hw flow control
  // init UART at default baud rate, no parity bits, ho hw flow control
  neorv32_uart_setup(BAUD_RATE, PARITY_NONE, FLOW_CONTROL_NONE);
  neorv32_uart0_setup(BAUD_RATE, PARITY_NONE, FLOW_CONTROL_NONE);
 
 
  // check available hardware extensions and compare with compiler flags
  // check available hardware extensions and compare with compiler flags
  neorv32_rte_check_isa(0); // silent = 0 -> show message if isa mismatch
  neorv32_rte_check_isa(0); // silent = 0 -> show message if isa mismatch
}
}
 
 
Line 143... Line 143...
 
 
/*-----------------------------------------------------------*/
/*-----------------------------------------------------------*/
 
 
void vSendString( const char * pcString )
void vSendString( const char * pcString )
{
{
        neorv32_uart_print( ( const char * ) pcString );
        neorv32_uart0_print( ( const char * ) pcString );
}
}
 
 
/*-----------------------------------------------------------*/
/*-----------------------------------------------------------*/
 
 
void vApplicationMallocFailedHook( void )
void vApplicationMallocFailedHook( void )
Line 161... Line 161...
        heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE in
        heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE in
        FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used
        FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used
        to query the size of free heap space that remains (although it does not
        to query the size of free heap space that remains (although it does not
        provide information on how the remaining heap might be fragmented). */
        provide information on how the remaining heap might be fragmented). */
        taskDISABLE_INTERRUPTS();
        taskDISABLE_INTERRUPTS();
  neorv32_uart_print("FreeRTOS_FAULT: vApplicationMallocFailedHook (solution: increase 'configTOTAL_HEAP_SIZE' in FreeRTOSConfig.h)\n");
  neorv32_uart0_print("FreeRTOS_FAULT: vApplicationMallocFailedHook (solution: increase 'configTOTAL_HEAP_SIZE' in FreeRTOSConfig.h)\n");
        __asm volatile( "ebreak" );
        __asm volatile( "ebreak" );
        for( ;; );
        for( ;; );
}
}
/*-----------------------------------------------------------*/
/*-----------------------------------------------------------*/
 
 
Line 192... Line 192...
 
 
        /* Run time stack overflow checking is performed if
        /* Run time stack overflow checking is performed if
        configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2.  This hook
        configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2.  This hook
        function is called if a stack overflow is detected. */
        function is called if a stack overflow is detected. */
        taskDISABLE_INTERRUPTS();
        taskDISABLE_INTERRUPTS();
  neorv32_uart_print("FreeRTOS_FAULT: vApplicationStackOverflowHook\n");
  neorv32_uart0_print("FreeRTOS_FAULT: vApplicationStackOverflowHook\n");
        __asm volatile( "ebreak" );
        __asm volatile( "ebreak" );
        for( ;; );
        for( ;; );
}
}
 
 
/*-----------------------------------------------------------*/
/*-----------------------------------------------------------*/
Line 215... Line 215...
/*-----------------------------------------------------------*/
/*-----------------------------------------------------------*/
 
 
/* This handler is responsible for handling all interrupts. Only the machine timer interrupt is handled by the kernel. */
/* This handler is responsible for handling all interrupts. Only the machine timer interrupt is handled by the kernel. */
void SystemIrqHandler( uint32_t mcause )
void SystemIrqHandler( uint32_t mcause )
{
{
  neorv32_uart_printf("freeRTOS: Unknown interrupt (0x%x)\n", mcause);
  neorv32_uart0_printf("freeRTOS: Unknown interrupt (0x%x)\n", mcause);
}
}
 
 
 
 
 
 
 
 
Line 230... Line 230...
 
 
#include <neorv32.h>
#include <neorv32.h>
int main() {
int main() {
 
 
  // init UART at default baud rate, no parity bits, ho hw flow control
  // init UART at default baud rate, no parity bits, ho hw flow control
  neorv32_uart_setup(BAUD_RATE, PARITY_NONE, FLOW_CONTROL_NONE);
  neorv32_uart0_setup(BAUD_RATE, PARITY_NONE, FLOW_CONTROL_NONE);
  neorv32_uart_print("ERROR! FreeRTOS has not been compiled. Use >>make USER_FLAGS+=-DRUN_FREERTOS_DEMO clean_all exe<< to compile it.\n");
  neorv32_uart0_print("ERROR! FreeRTOS has not been compiled. Use >>make USER_FLAGS+=-DRUN_FREERTOS_DEMO clean_all exe<< to compile it.\n");
  return 1;
  return 1;
}
}
#endif
#endif
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.