Hi,
Did anyone succeede using FreeRTOS on ATMega8?
I changed main.c from the ATMega323 demo expecting to get a LED on PORTB.2 blinking but this most don't work. Idle and Flashing threads start (at least code is entered) but I do not get the LED blinking whatever my routine is. I have not much debug tools...
I tried to tweak parameters in portmacro.h (portMAX_PRIORITIES to 1, portMINIMAL_STACK_SIZE between 5 and 20) but this does not bring the code to work.
Below you will find main.c.
Regards
#include #include
#include "projdefs.h" #include "portable.h" #include "task.h"
static void vLEDFlashTask( void *pvParameters );
portSHORT main( void ) { outp( 0x04, DDRB ); outp( 0x00, DDRC ); outp( 0x00, DDRD );
outp( 0xff, PORTB ); outp( 0xff, PORTC ); outp( 0xff, PORTD );
sTaskCreate( vLEDFlashTask, ( const portCHAR * const ) "LEDx", portMINIMAL_STACK_SIZE, NULL, 1, ( xTaskHandle * ) NULL );
vTaskStartScheduler( portUSE_PREEMPTION );
return 0; }
static void vLEDFlashTask( void *pvParameters ) { for(;;) { portTickType xFlashRate = ( portTickType ) 200; xFlashRate /= portTICKS_PER_MS; xFlashRate /= ( portTickType ) 2;
cbi( PORTB, 2 ); vTaskDelay( xFlashRate ); sbi( PORTB, 2 ); vTaskDelay( xFlashRate ); } }