Skip to content

Commit 15bc866

Browse files
authored
Add atomic flag for 16-bit ticks PIC24 (#488)
This change allows the PIC24 family of 16 bit processors to read the tick count without a critical section when the tick count is 16 bits. Inspired from discussion - https://forums.freertos.org/t/xtaskgettickcount-with-critical-section-on-16-bit-mcu/14860/5
1 parent d5b95c9 commit 15bc866

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

portable/MPLAB/PIC24_dsPIC/portmacro.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ typedef unsigned short UBaseType_t;
5959
#if( configUSE_16_BIT_TICKS == 1 )
6060
typedef uint16_t TickType_t;
6161
#define portMAX_DELAY ( TickType_t ) 0xffff
62+
/* 16-bit tick type on a 16-bit architecture, so reads of the tick count do
63+
* not need to be guarded with a critical section. */
64+
#define portTICK_TYPE_IS_ATOMIC 1
6265
#else
6366
typedef uint32_t TickType_t;
6467
#define portMAX_DELAY ( TickType_t ) 0xffffffffUL

0 commit comments

Comments
 (0)