Merge pull request #179 from osamuaoki/teensy2
authorDean Camera <dean@fourwalledcubicle.com>
Sun, 12 Dec 2021 03:54:56 +0000 (03:54 +0000)
committerGitHub <noreply@github.com>
Sun, 12 Dec 2021 03:54:56 +0000 (03:54 +0000)
Add board definitions for the Teensy 1.0++ and Teensy 2.0++, so that their bootloader addresses can be differentiated in the HID class bootloader.

Bootloaders/HID/HostLoaderApp/hid_bootloader_cli.c
BuildTests/BoardDriverTest/BoardDeviceMap.cfg
LUFA/Common/BoardTypes.h
LUFA/Drivers/Board/AVR8/TEENSY/Board.h
LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h
LUFA/Drivers/Board/Board.h
LUFA/Drivers/Board/LEDs.h

index f29dc81..fbd9f94 100644 (file)
@@ -1118,6 +1118,8 @@ static const struct {
 
        // Add duplicates that match friendly Teensy Names
        // Match board names in boards.txt
+       {"TEENSY",      15872,   128},
+       {"TEENSYPP",    64512,   256},
        {"TEENSY2",     32256,   128},
        {"TEENSY2PP",  130048,   256},
        {"TEENSYLC",    63488,   512},
index 94324f3..2100ed2 100644 (file)
@@ -56,7 +56,9 @@ BOARD_SPARKFUN8U2       = AVR8  : atmega8u2      :
 BOARD_STK525            = AVR8  : at90usb647     :
 BOARD_STK526            = AVR8  : at90usb162     :
 BOARD_TEENSY            = AVR8  : at90usb162     :
-BOARD_TEENSY2           = AVR8  : at90usb646     :
+BOARD_TEENSYPP          = AVR8  : at90usb646     :
+BOARD_TEENSY2           = AVR8  : atmega32u4     :
+BOARD_TEENSY2PP         = AVR8  : at90usb1286    :
 BOARD_TUL               = AVR8  : atmega32u4     :
 BOARD_UDIP              = AVR8  : atmega32u2     :
 BOARD_UNO               = AVR8  : atmega8u2      :
index eb24296..c641438 100644 (file)
                        /** Selects the Atmel Xplained-MINI specific board drivers, including the driver for the board LEDs. */
                        #define BOARD_XPLAINED_MINI        60
 
+                       /** Selects the Teensy version 1.x ++ specific board drivers, including the driver for the board LEDs. */
+                       #define BOARD_TEENSYPP             61
+
+                       /** Selects the Teensy version 2.x ++ specific board drivers, including the driver for the board LEDs. */
+                       #define BOARD_TEENSY2PP            62
+
+
                        #if !defined(__DOXYGEN__)
                                #define BOARD_                 BOARD_NONE
 
index 2e0a68d..e93080a 100644 (file)
  */
 
 /** \ingroup Group_BoardInfo
+ *  \defgroup Group_BoardInfo_TEENSY2 TEENSY2PP
+ *  \brief Board specific information header for the PJRC Teensy 2 ++ boards.
+ *
+ *  See \ref Group_BoardInfo_TEENSY for more details.
+ */
+
+/** \ingroup Group_BoardInfo
  *  \defgroup Group_BoardInfo_TEENSY2 TEENSY2
  *  \brief Board specific information header for the PJRC Teensy 2 boards.
  *
  */
 
 /** \ingroup Group_BoardInfo
+ *  \defgroup Group_BoardInfo_TEENSY TEENSYPP
+ *  \brief Board specific information header for the PJRC Teensy 1 ++ boards.
+ *
+ *  See \ref Group_BoardInfo_TEENSY for more details.
+ */
+
+/** \ingroup Group_BoardInfo
  *  \defgroup Group_BoardInfo_TEENSY TEENSY
- *  \brief Board specific information header for the PJRC Teensy 1.x/2.x boards.
+ *  \brief Board specific information header for the PJRC Teensy 1 boards.
  *
- *  Board specific information header for the PJRC Teensy boards (http://www.pjrc.com/teensy/index.html).
+ *  Board specific information header for the PJRC Teensy 1, 1++, 2, 2 ++ boards (http://www.pjrc.com/teensy/index.html).
  *
  *  @{
  */
index f465a83..19d4d71 100644 (file)
  */
 
 /** \ingroup Group_LEDs
+ *  \defgroup Group_LEDs_TEENSY2PP TEENSY2PP
+ *  \brief Board specific LED driver header for the PJRC Teensy 2 ++ boards.
+ *
+ *  See \ref Group_LEDs_TEENSY for more details.
+ */
+
+/** \ingroup Group_LEDs
  *  \defgroup Group_LEDs_TEENSY2 TEENSY2
  *  \brief Board specific LED driver header for the PJRC Teensy 2 boards.
  *
  */
 
 /** \ingroup Group_LEDs
+ *  \defgroup Group_LEDs_TEENSYPP TEENSYPP
+ *  \brief Board specific LED driver header for the PJRC Teensy 1 ++ boards.
+ *
+ *  See \ref Group_LEDs_TEENSY for more details.
+ */
+
+/** \ingroup Group_LEDs
  *  \defgroup Group_LEDs_TEENSY TEENSY
  *  \brief Board specific LED driver header for the PJRC Teensy 1.x/2.x boards.
  *
+ *  \note For version 2 ++ Teensy boards, compile with <code>BOARD = TEENSY2PP</code>.
+ *
  *  \note For version 2 Teensy boards, compile with <code>BOARD = TEENSY2</code>.
  *
+ *  \note For version 1 ++  Teensy boards, compile with <code>BOARD = TEENSYPP</code>.
+ *
+ *  \note For version 1 Teensy boards, compile with <code>BOARD = TEENSY</code>.
+ *
  *  Board specific LED driver header for the PJRC Teensy boards (http://www.pjrc.com/teensy/index.html).
  *
- *  <b>TEENSY</b>:
+ *  <b>TEENSY</b>, <b>TEENSYPP</b>:
  *  <table>
  *    <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
  *    <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>High</td><td>PORTD.6</td></tr>
  *  </table>
  *
- *  <b>TEENSY2</b>:
+ *  <b>TEENSY2</b>, <b>TEENSY2PP</b>:
  *  <table>
  *    <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
  *    <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>Low</td><td>PORTD.6</td></tr>
                        {
                                DDRD  |= LEDS_ALL_LEDS;
 
-                               #if (BOARD == BOARD_TEENSY2)
+                               #if (BOARD == BOARD_TEENSY2) || (BOARD == BOARD_TEENSY2PP)
                                PORTD &= ~LEDS_ALL_LEDS;
                                #else
                                PORTD |=  LEDS_ALL_LEDS;
 
                        static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
                        {
-                               #if (BOARD == BOARD_TEENSY2)
+                               #if (BOARD == BOARD_TEENSY2) || (BOARD == BOARD_TEENSY2PP)
                                PORTD |=  LEDMask;
                                #else
                                PORTD &= ~LEDMask;
 
                        static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask)
                        {
-                               #if (BOARD == BOARD_TEENSY2)
+                               #if (BOARD == BOARD_TEENSY2) || (BOARD == BOARD_TEENSY2PP)
                                PORTD &= ~LEDMask;
                                #else
                                PORTD |=  LEDMask;
 
                        static inline void LEDs_SetAllLEDs(const uint8_t LEDMask)
                        {
-                               #if (BOARD == BOARD_TEENSY2)
+                               #if (BOARD == BOARD_TEENSY2) || (BOARD == BOARD_TEENSY2PP)
                                PORTD = ((PORTD & ~LEDS_ALL_LEDS) | LEDMask);
                                #else
                                PORTD = ((PORTD | LEDS_ALL_LEDS) & ~LEDMask);
                        static inline void LEDs_ChangeLEDs(const uint8_t LEDMask,
                                                           const uint8_t ActiveMask)
                        {
-                               #if (BOARD == BOARD_TEENSY2)
+                               #if (BOARD == BOARD_TEENSY2) || (BOARD == BOARD_TEENSY2PP)
                                PORTD = ((PORTD & ~LEDMask) | ActiveMask);
                                #else
                                PORTD = ((PORTD | LEDMask) & ~ActiveMask);
                        static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
                        static inline uint8_t LEDs_GetLEDs(void)
                        {
-                               #if (BOARD == BOARD_TEENSY2)
+                               #if (BOARD == BOARD_TEENSY2) || (BOARD == BOARD_TEENSY2PP)
                                return (PORTD & LEDS_ALL_LEDS);
                                #else
                                return (~PORTD & LEDS_ALL_LEDS);
index 457bfbf..fc6c3f2 100644 (file)
@@ -79,7 +79,8 @@
                        #include "AVR8/BUMBLEB/Board.h"
                #elif (BOARD == BOARD_EVK527)
                        #include "AVR8/EVK527/Board.h"
-               #elif ((BOARD == BOARD_TEENSY) || (BOARD == BOARD_TEENSY2))
+               #elif ((BOARD == BOARD_TEENSY) || (BOARD == BOARD_TEENSYPP)) || \
+                     ((BOARD == BOARD_TEENSY2) || (BOARD == BOARD_TEENSY2PP))
                        #include "AVR8/TEENSY/Board.h"
                #elif (BOARD == BOARD_USBTINYMKII)
                        #include "AVR8/USBTINYMKII/Board.h"
index db34e68..5e56a6e 100644 (file)
                        #include "AVR8/BUMBLEB/LEDs.h"
                #elif (BOARD == BOARD_EVK527)
                        #include "AVR8/EVK527/LEDs.h"
-               #elif ((BOARD == BOARD_TEENSY) || (BOARD == BOARD_TEENSY2))
+               #elif ((BOARD == BOARD_TEENSY) || (BOARD == BOARD_TEENSYPP)) || \
+                     ((BOARD == BOARD_TEENSY2) || (BOARD == BOARD_TEENSY2PP))
                        #include "AVR8/TEENSY/LEDs.h"
                #elif (BOARD == BOARD_USBTINYMKII)
                        #include "AVR8/USBTINYMKII/LEDs.h"