Skip to content

Commit 9d96f63

Browse files
committed
Move I2C mux to variant
1 parent 9bf5ba1 commit 9d96f63

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

cores/arduino/wiring.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -434,11 +434,6 @@ void init()
434434

435435
//#endif
436436

437-
/****************************** TWI *******************************************/
438-
439-
// PORTMUX.TWISPIROUTEA = (PORTMUX_TWI0_ALT1_gc | PORTMUX_SPI0_ALT2_gc);
440-
441-
442437
/****************************** USART *****************************************/
443438

444439
#ifdef REV_A_ENGINEERING_SAMPLE

libraries/Wire/src/utility/twi.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ void TWI_MasterInit(uint32_t frequency)
3737

3838
// Enable pullups just in case, should have external ones though
3939
//pinMode(PIN_WIRE_SDA, INPUT_PULLUP);
40-
//pinMode(PIN_WIRE_SCL, INPUT_PULLUP);
41-
40+
//pinMode(PIN_WIRE_SCL, INPUT_PULLUP);
41+
42+
PORTMUX.TWISPIROUTEA |= TWI_MUX;
43+
4244
twi_mode = TWI_MODE_MASTER;
4345

4446
master_bytesRead = 0;

variants/uno2018/pins_arduino.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,4 +349,6 @@ const uint8_t PROGMEM digital_pin_to_timer[] = {
349349
#define SERIAL_PORT_USBVIRTUAL Serial1
350350
#define SERIAL_PORT_HARDWARE_OPEN Serial2
351351

352+
#define TWI_MUX PORTMUX_TWI0_DEFAULT_gc //PORTMUX_TWI0_ALT1_gc
353+
352354
#endif

0 commit comments

Comments
 (0)