Skip to content

Commit

Permalink
Merge pull request #3 from tbowmo/master
Browse files Browse the repository at this point in the history
Fixed problem with USB / I2C clash
  • Loading branch information
tbowmo authored Sep 6, 2016
2 parents dfe8b54 + b3c9070 commit 2f25bd4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification

name=Mysensors SAMD (32-bits ARM Cortex-M0+) Boards
version=1.0.2
version=1.0.3

# Compile variables
# -----------------
Expand Down
6 changes: 5 additions & 1 deletion variants/mysensors_gw/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ const PinDescription g_APinDescription[]=
| 42 | RFM_DIO5 | PB05 | | 5 | 13 | | Y11 | | | | | | | |
| 43 | RESET_RFM | PB10 | | 10 | | | | | | 4/2 | TC5/0 | TCC0/4 | I2S/MCK1 | GCLK_IO4 |
| 44 | SECURITY | PA11 | ATSHA204 | 11 | 19 | | X03 | | 0/3 | 2/3 | TCC1/1 | TCC0/3 | I2S/FS0 | GCLK_IO5 |
| 45 | | PA24 | USB_NEGATIVE | *USB/DM
| 46 | | PA25 | USB_POSITIVE | *USB/DP
+------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+
*/

Expand All @@ -152,7 +154,9 @@ const PinDescription g_APinDescription[]=
{ PORTB, 1, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_1 },
{ PORTB, 5, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 },
{ PORTB, 10, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 },
{ PORTA, 11, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE}
{ PORTA, 11, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE},
{ PORTA, 24, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DM
{ PORTA, 25, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE } // USB/DP
};

const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM]={ TCC0, TCC1, TCC2, TC3, TC4, TC5 } ;
Expand Down
14 changes: 8 additions & 6 deletions variants/mysensors_gw/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ extern "C" {
// #define digitalPinToTimer(P)

// LEDs
#define PIN_LED_13 (7u)
#define PIN_LED_RXL (6u)
#define PIN_LED_TXL (12u)
#define PIN_LED_13 (16u)
#define PIN_LED_RXL LED_ORANGE
#define PIN_LED_TXL LED_ORANGE
#define PIN_LED LED_BLUE
#define PIN_LED2 LED_RED
#define PIN_LED4 LED_GREEN
Expand Down Expand Up @@ -181,16 +181,18 @@ static const uint8_t SCK2 = PIN_SPI2_SCK;

#define PIN_WIRE_SDA (07u)
#define PIN_WIRE_SCL (06u)
#define PERIPH_WIRE sercom3
#define WIRE_IT_HANDLER SERCOM3_Handler

static const uint8_t SDA = PIN_WIRE_SDA;
static const uint8_t SCL = PIN_WIRE_SCL;

/*
* USB
*/
#define PIN_USB_HOST_ENABLE (27ul)
#define PIN_USB_DM (28ul)
#define PIN_USB_DP (29ul)
#define PIN_USB_HOST_ENABLE LED_ORANGE
#define PIN_USB_DM (45ul)
#define PIN_USB_DP (46ul)

#ifdef __cplusplus
}
Expand Down

0 comments on commit 2f25bd4

Please sign in to comment.