mirror of
https://github.com/FreeRTOS/FreeRTOS.git
synced 2026-09-28 16:16:47 +08:00
Updated IAR RL78 port layer.
This commit is contained in:
@@ -76,6 +76,10 @@
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
|
||||
/* Hardware includes. */
|
||||
#include "port_iodefine.h"
|
||||
#include "port_iodefine_ext.h"
|
||||
|
||||
/* The critical nesting value is initialised to a non zero value to ensure
|
||||
interrupts don't accidentally become enabled before the scheduler is started. */
|
||||
#define portINITIAL_CRITICAL_NESTING ( ( unsigned short ) 10 )
|
||||
@@ -154,7 +158,7 @@ unsigned long *pulLocal;
|
||||
/* The start address / PSW value is also written in as a 32bit value,
|
||||
so leave a space for the second two bytes. */
|
||||
pxTopOfStack--;
|
||||
|
||||
|
||||
/* Task function start address combined with the PSW. */
|
||||
pulLocal = ( unsigned long * ) pxTopOfStack;
|
||||
*pulLocal = ( ( ( unsigned long ) pxCode ) | ( portPSW << 24UL ) );
|
||||
@@ -190,7 +194,7 @@ unsigned long *pulLocal;
|
||||
*pxTopOfStack = ( portSTACK_TYPE ) 0x0F00;
|
||||
pxTopOfStack--;
|
||||
|
||||
/* Finally the remaining general purpose registers DE and BC */
|
||||
/* The remaining general purpose registers DE and BC */
|
||||
*pxTopOfStack = ( portSTACK_TYPE ) 0xDEDE;
|
||||
pxTopOfStack--;
|
||||
*pxTopOfStack = ( portSTACK_TYPE ) 0xBCBC;
|
||||
@@ -198,7 +202,7 @@ unsigned long *pulLocal;
|
||||
|
||||
/* Finally the critical section nesting count is set to zero when the task
|
||||
first starts. */
|
||||
*pxTopOfStack = ( portSTACK_TYPE ) portNO_CRITICAL_SECTION_NESTING;
|
||||
*pxTopOfStack = ( portSTACK_TYPE ) portNO_CRITICAL_SECTION_NESTING;
|
||||
|
||||
/* Return a pointer to the top of the stack that has beene generated so it
|
||||
can be stored in the task control block for the task. */
|
||||
@@ -237,28 +241,25 @@ const unsigned short usCompareMatch = ( usClockHz / configTICK_RATE_HZ ) + 1UL;
|
||||
|
||||
/* Supply the RTC clock. */
|
||||
RTCEN = ( unsigned char ) 1U;
|
||||
|
||||
|
||||
/* Disable ITMC operation. */
|
||||
ITMC = ( unsigned char ) 0x0000;
|
||||
|
||||
|
||||
/* Disable INTIT interrupt. */
|
||||
ITMK = ( unsigned char ) 1;
|
||||
|
||||
|
||||
/* Set INTIT high priority */
|
||||
ITPR1 = ( unsigned char ) 1;
|
||||
ITPR0 = ( unsigned char ) 1;
|
||||
|
||||
|
||||
/* Clear INIT interrupt. */
|
||||
ITIF = ( unsigned char ) 0;
|
||||
|
||||
/* Set interval and enable interrupt operation. */
|
||||
ITMC = usCompareMatch | 0x8000U;
|
||||
|
||||
|
||||
/* Enable INTIT interrupt. */
|
||||
ITMK = ( unsigned char ) 0;
|
||||
|
||||
/* Enable IT operation. */
|
||||
// ITMC |= 0x8000;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
;/*
|
||||
; FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.
|
||||
;
|
||||
;
|
||||
;
|
||||
; ***************************************************************************
|
||||
; * *
|
||||
@@ -72,7 +72,7 @@ vPortYield:
|
||||
portRESTORE_CONTEXT ; Restore the context of the next task to run.
|
||||
retb
|
||||
|
||||
|
||||
|
||||
; Starts the scheduler by restoring the context of the task that will execute
|
||||
; first.
|
||||
RSEG CODE:CODE
|
||||
|
||||
@@ -75,9 +75,6 @@
|
||||
#ifndef PORTMACRO_H
|
||||
#define PORTMACRO_H
|
||||
|
||||
#include "port_iodefine.h"
|
||||
#include "port_iodefine_ext.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -99,7 +96,7 @@ extern "C" {
|
||||
#if __DATA_MODEL__ == __DATA_MODEL_NEAR__ && __CODE_MODEL__ == __CODE_MODEL_FAR__
|
||||
#warning This port has not been tested with your selected memory model combination. If a far code model is required it is recommended to also use a far data model.
|
||||
#endif
|
||||
|
||||
|
||||
/* Type definitions. */
|
||||
|
||||
#define portCHAR char
|
||||
@@ -116,7 +113,7 @@ extern "C" {
|
||||
#define portPOINTER_SIZE_TYPE unsigned short
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if ( configUSE_16_BIT_TICKS == 1 )
|
||||
typedef unsigned int portTickType;
|
||||
#define portMAX_DELAY ( portTickType ) 0xffff
|
||||
@@ -124,7 +121,7 @@ extern "C" {
|
||||
typedef unsigned long portTickType;
|
||||
#define portMAX_DELAY ( portTickType ) 0xffffffff
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Interrupt control macros. */
|
||||
#define portDISABLE_INTERRUPTS() __asm ( "DI" )
|
||||
@@ -174,7 +171,7 @@ extern volatile unsigned short usCriticalNesting; \
|
||||
/* Hardwware specifics. */
|
||||
#define portBYTE_ALIGNMENT 2
|
||||
#define portSTACK_GROWTH ( -1 )
|
||||
#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ )
|
||||
#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Task function macros as described on the FreeRTOS.org WEB site. */
|
||||
|
||||
Reference in New Issue
Block a user