#define HWTC_DIVISOR 1\r
#define IRQ_PRIORITY_ORDER 1 // higher IRQ priority values are more significant\r
\r
-#elif (SELECTED_PORT == PORT_MICROCHIP_PIC32MX || PORT_MICROCHIP_PIC32MZ)\r
+#elif (SELECTED_PORT == PORT_MICROCHIP_PIC32MX || SELECTED_PORT == PORT_MICROCHIP_PIC32MZ)\r
\r
#define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
#define HWTC_COUNT (TMR1)\r
#define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5aUL\r
#endif\r
\r
-/* The following endian values are used by FreeRTOS+ components, not FreeRTOS\r
+/* The following errno values are used by FreeRTOS+ components, not FreeRTOS \r
+itself. */\r
+#define pdFREERTOS_ERRNO_NONE 0 /* No errors */\r
+#define pdFREERTOS_ERRNO_ENOENT 2 /* No such file or directory */\r
+#define pdFREERTOS_ERRNO_EIO 5 /* I/O error */\r
+#define pdFREERTOS_ERRNO_ENXIO 6 /* No such device or address */\r
+#define pdFREERTOS_ERRNO_EBADF 9 /* Bad file number */\r
+#define pdFREERTOS_ERRNO_EAGAIN 11 /* No more processes */\r
+#define pdFREERTOS_ERRNO_EWOULDBLOCK 11 /* Operation would block */\r
+#define pdFREERTOS_ERRNO_ENOMEM 12 /* Not enough memory */\r
+#define pdFREERTOS_ERRNO_EACCES 13 /* Permission denied */\r
+#define pdFREERTOS_ERRNO_EFAULT 14 /* Bad address */\r
+#define pdFREERTOS_ERRNO_EBUSY 16 /* Mount device busy */\r
+#define pdFREERTOS_ERRNO_EEXIST 17 /* File exists */\r
+#define pdFREERTOS_ERRNO_EXDEV 18 /* Cross-device link */\r
+#define pdFREERTOS_ERRNO_ENODEV 19 /* No such device */\r
+#define pdFREERTOS_ERRNO_ENOTDIR 20 /* Not a directory */\r
+#define pdFREERTOS_ERRNO_EISDIR 21 /* Is a directory */\r
+#define pdFREERTOS_ERRNO_EINVAL 22 /* Invalid argument */\r
+#define pdFREERTOS_ERRNO_ENOSPC 28 /* No space left on device */\r
+#define pdFREERTOS_ERRNO_ESPIPE 29 /* Illegal seek */\r
+#define pdFREERTOS_ERRNO_EROFS 30 /* Read only file system */\r
+#define pdFREERTOS_ERRNO_EUNATCH 42 /* Protocol driver not attached */\r
+#define pdFREERTOS_ERRNO_EBADE 50 /* Invalid exchange */\r
+#define pdFREERTOS_ERRNO_EFTYPE 79 /* Inappropriate file type or format */\r
+#define pdFREERTOS_ERRNO_ENMFILE 89 /* No more files */\r
+#define pdFREERTOS_ERRNO_ENOTEMPTY 90 /* Directory not empty */\r
+#define pdFREERTOS_ERRNO_ENAMETOOLONG 91 /* File or path name too long */\r
+#define pdFREERTOS_ERRNO_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */\r
+#define pdFREERTOS_ERRNO_ENOBUFS 105 /* No buffer space available */\r
+#define pdFREERTOS_ERRNO_ENOPROTOOPT 109 /* Protocol not available */\r
+#define pdFREERTOS_ERRNO_EADDRINUSE 112 /* Address already in use */\r
+#define pdFREERTOS_ERRNO_ETIMEDOUT 116 /* Connection timed out */\r
+#define pdFREERTOS_ERRNO_EINPROGRESS 119 /* Connection already in progress */\r
+#define pdFREERTOS_ERRNO_EALREADY 120 /* Socket already connected */\r
+#define pdFREERTOS_ERRNO_EADDRNOTAVAIL 125 /* Address not available */\r
+#define pdFREERTOS_ERRNO_EISCONN 127 /* Socket is already connected */\r
+#define pdFREERTOS_ERRNO_ENOTCONN 128 /* Socket is not connected */\r
+#define pdFREERTOS_ERRNO_ENOMEDIUM 135 /* No medium inserted */\r
+#define pdFREERTOS_ERRNO_EILSEQ 138 /* An invalid UTF-16 sequence was encountered. */\r
+#define pdFREERTOS_ERRNO_ECANCELED 140 /* Operation canceled. */\r
+\r
+/* The following endian values are used by FreeRTOS+ components, not FreeRTOS \r
itself. */\r
#define pdFREERTOS_LITTLE_ENDIAN 0\r
#define pdFREERTOS_BIG_ENDIAN 1\r
* \ingroup SchedulerControl\r
*/\r
#define taskENTER_CRITICAL() portENTER_CRITICAL()\r
-#define taskENTER_CRITICAL_FROM_ISR( x ) portSET_INTERRUPT_MASK_FROM_ISR( x )\r
+#define taskENTER_CRITICAL_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()\r
\r
/**\r
* task. h\r
* \ingroup SchedulerControl\r
*/\r
#define taskEXIT_CRITICAL() portEXIT_CRITICAL()\r
-#define taskEXIT_CRITICAL_FROM_ISR() portCLEAR_INTERRUPT_MASK_FROM_ISR()\r
+#define taskEXIT_CRITICAL_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( x )\r
/**\r
* task. h\r
*\r
*\r
* See the xTimerCreate() API function example usage scenario.\r
*/\r
-void *pvTimerGetTimerID( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;\r
+void *pvTimerGetTimerID( const TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;\r
\r
/**\r
* void vTimerSetTimerID( TimerHandle_t xTimer, void *pvNewID );\r
*\r
* See the xTimerCreate() API function example usage scenario.\r
*/\r
-void vTimerSetTimerID( const TimerHandle_t xTimer, void *pvNewID ) PRIVILEGED_FUNCTION;\r
+void vTimerSetTimerID( TimerHandle_t xTimer, void *pvNewID ) PRIVILEGED_FUNCTION;\r
\r
/**\r
* BaseType_t xTimerIsTimerActive( TimerHandle_t xTimer );\r
.global FreeRTOS_IRQ_Handler\r
.global FreeRTOS_SWI_Handler\r
.global vPortRestoreTaskContext\r
- .global vPortInstallFreeRTOSVectorTable\r
\r
\r
\r
tick interrupts. The priority is set below that of the simulated\r
interrupt handler so the interrupt event mutex is used for the\r
handshake / overrun protection. */\r
- pvHandle = CreateThread( NULL, 0, prvSimulatedPeripheralTimer, NULL, 0, NULL );\r
+ pvHandle = CreateThread( NULL, 0, prvSimulatedPeripheralTimer, NULL, CREATE_SUSPENDED, NULL );\r
if( pvHandle != NULL )\r
{\r
SetThreadPriority( pvHandle, THREAD_PRIORITY_BELOW_NORMAL );\r
SetThreadPriorityBoost( pvHandle, TRUE );\r
SetThreadAffinityMask( pvHandle, 0x01 );\r
+ ResumeThread( pvHandle );\r
}\r
\r
/* Start the highest priority task by obtaining its associated thread\r
PRIVILEGED_DATA static volatile BaseType_t xYieldPending = pdFALSE;\r
PRIVILEGED_DATA static volatile BaseType_t xNumOfOverflows = ( BaseType_t ) 0;\r
PRIVILEGED_DATA static UBaseType_t uxTaskNumber = ( UBaseType_t ) 0U;\r
-PRIVILEGED_DATA static volatile TickType_t xNextTaskUnblockTime = portMAX_DELAY;\r
+PRIVILEGED_DATA static volatile TickType_t xNextTaskUnblockTime = ( TickType_t ) 0U; /* Initialised to portMAX_DELAY; before the scheduler starts. */\r
\r
/* Context switches are held pending while the scheduler is suspended. Also,\r
interrupts must not manipulate the xGenericListItem of a TCB, or any of the\r
}\r
#endif /* configUSE_NEWLIB_REENTRANT */\r
\r
+ xNextTaskUnblockTime = portMAX_DELAY;\r
xSchedulerRunning = pdTRUE;\r
xTickCount = ( TickType_t ) 0U;\r
\r
}\r
/*-----------------------------------------------------------*/\r
\r
-void vTimerSetTimerID( const TimerHandle_t xTimer, void *pvNewID )\r
+void vTimerSetTimerID( TimerHandle_t xTimer, void *pvNewID )\r
{\r
Timer_t * const pxTimer = ( Timer_t * ) xTimer;\r
\r