nobody wrote on Tuesday, May 15, 2007:
Hello
My name is Jorge Pinto from Portugal. I have FreeRTOS working and I am happy, because I started about 8 months ago looking for a RTOS with just FreeSoftware, and realy like GCC-AVR and FreeRTOS
Well, the problem, I have one test code that flash a LED every some time, but, I would like to change the configTICK_RATE_HZ for a lower value, however, If I change it, It does not have result
My config:
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 8000000 )
#define configTICK_RATE_HZ ( ( portTickType ) 20 ) // 20 instead of original 1000!!
The task the flash the LED:
/*-----------------------------------------------------------*/
/*
#
# Task que vai ligar ou desligar o LED.
#
*/
static void vFlashLED( void *pvParameters )
{
/* The parameters are not used. */
( void ) pvParameters;
portTickType xLastWakeTime;
const portTickType xFreq_ligado = 2000; // 2 segundos
const portTickType xFreq_desligado = 1000; // 1 segundo
/* Cycle for ever. */
for( ;; )
{
// Ligar LED
PortCLatch = PORTC;
PORTC = (PortCLatch | (1 << 0));
// Initialise the xLastWakeTime variable with the current time.
xLastWakeTime = xTaskGetTickCount();
vTaskDelayUntil( &xLastWakeTime, xFreq_ligado );
// Desligar LED
PortCLatch = PORTC;
PORTC = (PortCLatch & (0 << 0));
// Initialise the xLastWakeTime variable with the current time.
xLastWakeTime = xTaskGetTickCount();
vTaskDelayUntil( &xLastWakeTime, xFreq_desligado );
}
}
If I change xFreq_ligado and xFreq_desligado, the flash time alters, but not If I change configTICK_RATE_HZ
—
Another question, I have this macro:
#define #define FlashLED (0); (0);
and If a do: PORTC = (PortCLatch & (0 << (FlashLED) )); I get an error?? Why?? - I am doing this instead: PORTC = (PortCLatch & (0 << 0));
Thanks in advance.
Jorge Pinto
http://www.Casainho.net