Forum Discussion
First of all, thank you for your answer.
I have tested what you have mentioned, but I had to change this definition
const TickType_t xDelay = 500 / portTICK_PERIOD_MS;For this one
const portTickType xDelay = 500 / portTICK_RATE_MS;Because the re was no definition of TickType_t and portTICK_PERIOD_MS. Is it a problem?
This is my pormacro.h file where they are defined
#ifndef PORTMACRO_H
#define PORTMACRO_H
#ifdef __cplusplus
extern "C" {
#endif
#include "sys/alt_irq.h"
/*-----------------------------------------------------------
* Port specific definitions.
*
* The settings in this file configure FreeRTOS correctly for the
* given hardware and compiler.
*
* These settings should not be altered.
*-----------------------------------------------------------
*/
/* Type definitions. */
#define portCHAR char
#define portFLOAT float
#define portDOUBLE double
#define portLONG long
#define portSHORT short
#define portSTACK_TYPE unsigned portLONG
#define portBASE_TYPE long
#if( configUSE_16_BIT_TICKS == 1 )
typedef unsigned portSHORT portTickType;
#define portMAX_DELAY ( portTickType ) 0xffff
#else
typedef unsigned portLONG portTickType;
#define portMAX_DELAY ( portTickType ) 0xffffffff
#endif
/*-----------------------------------------------------------*/
/* Architecture specifics. */
#define portSTACK_GROWTH ( -1 )
#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ )
#define portBYTE_ALIGNMENT 4
#define portNOP() asm volatile ( "NOP" )
#define portCRITICAL_NESTING_IN_TCB 1
/*-----------------------------------------------------------*/
extern void vTaskSwitchContext( void );
#define portYIELD() asm volatile ( "trap" );
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) vTaskSwitchContext()
/* Include the port_asm.S file where the Context saving/restoring is defined. */
__asm__( "\n\t.globl save_context" );
/*-----------------------------------------------------------*/
extern void vTaskEnterCritical( void );
extern void vTaskExitCritical( void );
#define portDISABLE_INTERRUPTS() alt_irq_disable_all()
#define portENABLE_INTERRUPTS() alt_irq_enable_all( 0x01 );
#define portENTER_CRITICAL() vTaskEnterCritical()
#define portEXIT_CRITICAL() vTaskExitCritical()
/*-----------------------------------------------------------*/
/* Task function macros as described on the FreeRTOS.org WEB site. */
#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
#ifdef __cplusplus
}
#endif
#endif /* PORTMACRO_H */I apologize for the indentation in freeRTOSConfig.h but the vTaskDelay wouldn't be available without this line
#define INCLUDE_vTaskDelay 1I have tried different xDelay numbers, from 1, to 10000, but the systems keeps ignoring these pauses.
I want to add and correct some details of the behavior described above.
As far as I can see:
-The RS-232 terminal that is receiving all the messages coming out form the UART through the "imprimir" (print) function, are "T1" , "T2", "T1", "T2", so I understand that the system is inside that loop at a high speed, ignoring the vTakDelay and the delay functions.
-The 0x80 LED is on, so the interrupts are disabled
-The 0x01 and 0x02 LED's are both on at the same time, ignoring the blinking I was trying to produce with the delays functions
-The 0x04 LED is constant on too, so I can tell that the TIckHook is at least executed once, but it is not blinking, so I think the system never calls this interrupt again.
I do not understand why the program keeps ignoring both delays, the delay function and vTaskDelay.
Thank you again for your time.
Regards.