1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-18 07:52:14 +01:00

Wire library, move hard references IRQn to defines in variant.h

This commit is contained in:
dpslwk 2014-01-17 20:44:19 +00:00
parent c2e9860cff
commit 8364134ada
2 changed files with 10 additions and 8 deletions

View File

@ -343,10 +343,10 @@ static void Wire_Init(void) {
g_APinDescription[PIN_WIRE_SCL].ulPin,
g_APinDescription[PIN_WIRE_SCL].ulPinConfiguration);
NVIC_DisableIRQ(TWI1_IRQn);
NVIC_ClearPendingIRQ(TWI1_IRQn);
NVIC_SetPriority(TWI1_IRQn, 0);
NVIC_EnableIRQ(TWI1_IRQn);
NVIC_DisableIRQ(WIRE_ISR_ID);
NVIC_ClearPendingIRQ(WIRE_ISR_ID);
NVIC_SetPriority(WIRE_ISR_ID, 0);
NVIC_EnableIRQ(WIRE_ISR_ID);
}
TwoWire Wire = TwoWire(WIRE_INTERFACE, Wire_Init);
@ -370,10 +370,10 @@ static void Wire1_Init(void) {
g_APinDescription[PIN_WIRE1_SCL].ulPin,
g_APinDescription[PIN_WIRE1_SCL].ulPinConfiguration);
NVIC_DisableIRQ(TWI0_IRQn);
NVIC_ClearPendingIRQ(TWI0_IRQn);
NVIC_SetPriority(TWI0_IRQn, 0);
NVIC_EnableIRQ(TWI0_IRQn);
NVIC_DisableIRQ(WIRE1_ISR_ID);
NVIC_ClearPendingIRQ(WIRE1_ISR_ID);
NVIC_SetPriority(WIRE1_ISR_ID, 0);
NVIC_EnableIRQ(WIRE1_ISR_ID);
}
TwoWire Wire1 = TwoWire(WIRE1_INTERFACE, Wire1_Init);

View File

@ -128,12 +128,14 @@ extern "C"{
#define WIRE_INTERFACE TWI1
#define WIRE_INTERFACE_ID ID_TWI1
#define WIRE_ISR_HANDLER TWI1_Handler
#define WIRE_ISR_ID TWI1_IRQn
#define PIN_WIRE1_SDA (70u)
#define PIN_WIRE1_SCL (71u)
#define WIRE1_INTERFACE TWI0
#define WIRE1_INTERFACE_ID ID_TWI0
#define WIRE1_ISR_HANDLER TWI0_Handler
#define WIRE1_ISR_ID TWI0_IRQn
/*
* UART/USART Interfaces