ATmegaxxxx - discern architecture rather than device

This commit is contained in:
Phillip Stevens 2020-04-11 12:01:44 +10:00
parent 5e32393035
commit c19e711ba5
2 changed files with 6 additions and 6 deletions

View file

@ -222,7 +222,7 @@ void wdt_interrupt_reset_enable (const uint8_t value)
*
* r0 is set to __tmp_reg__ as the compiler expects it to be thus.
*
* #if defined(__AVR_ATmega2560__) || defined(__AVR_ATmega2561__)
* #if defined(__AVR_3_BYTE_PC__)
* #define __RAMPZ__ 0x3B
* #define __EIND__ 0x3C
* #endif
@ -230,7 +230,7 @@ void wdt_interrupt_reset_enable (const uint8_t value)
* The interrupts will have been disabled during the call to portSAVE_CONTEXT()
* so we need not worry about reading/writing to the stack pointer.
*/
#if defined(__AVR_ATmega2560__) || defined(__AVR_ATmega2561__)
#if defined(__AVR_3_BYTE_PC__)
/* 3-Byte PC Save */
#define portSAVE_CONTEXT() \
__asm__ __volatile__ ( "push __tmp_reg__ \n\t" \
@ -332,7 +332,7 @@ void wdt_interrupt_reset_enable (const uint8_t value)
* Opposite to portSAVE_CONTEXT(). Interrupts will have been disabled during
* the context save so we can write to the stack pointer.
*/
#if defined(__AVR_ATmega2560__) || defined(__AVR_ATmega2561__)
#if defined(__AVR_3_BYTE_PC__)
/* 3-Byte PC Restore */
#define portRESTORE_CONTEXT() \
__asm__ __volatile__ ( "lds r26, pxCurrentTCB \n\t" \
@ -451,7 +451,7 @@ uint16_t usAddress;
/* The start of the task code will be popped off the stack last, so place
it on first. */
#if defined(__AVR_ATmega2560__) || defined(__AVR_ATmega2561__)
#if defined(__AVR_3_BYTE_PC__)
/* The AVR ATmega2560/ATmega2561 have 256KBytes of program memory and a 17-bit
* program counter. When a code address is stored on the stack, it takes 3 bytes
* instead of 2 for the other ATmega* chips.
@ -491,7 +491,7 @@ uint16_t usAddress;
*pxTopOfStack = portFLAGS_INT_ENABLED;
pxTopOfStack--;
#if defined(__AVR_ATmega2560__) || defined(__AVR_ATmega2561__)
#if defined(__AVR_3_BYTE_PC__)
/* If we have an ATmega256x, we are also saving the RAMPZ and EIND registers.
* We should default those to 0.

View file

@ -132,7 +132,7 @@ extern void vPortYield( void ) __attribute__ ( ( naked ) );
#define portYIELD() vPortYield()
/*-----------------------------------------------------------*/
#if defined(__AVR_ATmega2560__) || defined(__AVR_ATmega2561__)
#if defined(__AVR_3_BYTE_PC__)
/* Task function macros as described on the FreeRTOS.org WEB site. */
/* Add .lowtext tag from the avr linker script avr6.x for ATmega2560 and ATmega2561