@@ -257,25 +257,17 @@ void TwoWire::onService(void)
257257}
258258
259259#if WIRE_INTERFACES_COUNT > 0
260- /* static void Wire_Init(void) {
261- pmc_enable_periph_clk(WIRE_INTERFACE_ID);
262- PIO_Configure(
263- g_APinDescription[PIN_WIRE_SDA].pPort,
264- g_APinDescription[PIN_WIRE_SDA].ulPinType,
265- g_APinDescription[PIN_WIRE_SDA].ulPin,
266- g_APinDescription[PIN_WIRE_SDA].ulPinConfiguration);
267- PIO_Configure(
268- g_APinDescription[PIN_WIRE_SCL].pPort,
269- g_APinDescription[PIN_WIRE_SCL].ulPinType,
270- g_APinDescription[PIN_WIRE_SCL].ulPin,
271- g_APinDescription[PIN_WIRE_SCL].ulPinConfiguration);
272-
273- NVIC_DisableIRQ(WIRE_ISR_ID);
274- NVIC_ClearPendingIRQ(WIRE_ISR_ID);
275- NVIC_SetPriority(WIRE_ISR_ID, 0);
276- NVIC_EnableIRQ(WIRE_ISR_ID);
277- }*/
278260
261+ /* In case new variant doesn't define these macros,
262+ * we put here the ones for Arduino Zero.
263+ *
264+ * These values should be different on some variants!
265+ */
266+
267+ #ifndef PERIPH_WIRE
268+ # define PERIPH_WIRE sercom3
269+ # define WIRE_IT_HANDLER SERCOM3_Handler
270+ #endif // PERIPH_WIRE
279271
280272TwoWire Wire (&PERIPH_WIRE, PIN_WIRE_SDA, PIN_WIRE_SCL);
281273
0 commit comments