@@ -17,7 +17,7 @@ TwoWire *wi;
17
17
const char version[] = " 0.1.7" ;
18
18
19
19
20
- // INTERFACE COUNT (TESTED TEENSY 3.5 ONLY)
20
+ // INTERFACE COUNT (TESTED TEENSY 3.5 AND ARDUINO DUE ONLY)
21
21
int wirePortCount = 1 ;
22
22
int selectedWirePort = 0 ;
23
23
@@ -62,15 +62,15 @@ void setup()
62
62
Serial.begin (115200 );
63
63
Wire.begin ();
64
64
65
- #ifdef WIRE_IMPLEMENT_WIRE1
65
+ #if defined WIRE_IMPLEMENT_WIRE1 || WIRE_INTERFACES_COUNT > 1
66
66
Wire1.begin ();
67
67
wirePortCount++;
68
68
#endif
69
- #ifdef WIRE_IMPLEMENT_WIRE2
69
+ #if defined WIRE_IMPLEMENT_WIRE2 || WIRE_INTERFACES_COUNT > 2
70
70
Wire2.begin ();
71
71
wirePortCount++;
72
72
#endif
73
- #ifdef WIRE_IMPLEMENT_WIRE3
73
+ #if defined WIRE_IMPLEMENT_WIRE3 || WIRE_INTERFACES_COUNT > 3
74
74
Wire3.begin ();
75
75
wirePortCount++;
76
76
#endif
@@ -97,17 +97,17 @@ void loop()
97
97
wi = &Wire;
98
98
break ;
99
99
case 1 :
100
- #ifdef WIRE_IMPLEMENT_WIRE1
100
+ #if defined WIRE_IMPLEMENT_WIRE1 || WIRE_INTERFACES_COUNT > 1
101
101
wi = &Wire1;
102
102
#endif
103
103
break ;
104
104
case 2 :
105
- #ifdef WIRE_IMPLEMENT_WIRE2
105
+ #if defined WIRE_IMPLEMENT_WIRE2 || WIRE_INTERFACES_COUNT > 2
106
106
wi = &Wire2;
107
107
#endif
108
108
break ;
109
109
case 3 :
110
- #ifdef WIRE_IMPLEMENT_WIRE3
110
+ #if defined WIRE_IMPLEMENT_WIRE3 || WIRE_INTERFACES_COUNT > 3
111
111
wi = &Wire3;
112
112
#endif
113
113
break ;
@@ -250,7 +250,7 @@ void displayHelp()
250
250
Serial.println ();
251
251
Serial.print (F (" I2C ports: " ));
252
252
Serial.println (wirePortCount);
253
- Serial.println (F (" \t @ = toggle Wire - Wire1 - Wire2 [TEENSY 3.5]" ));
253
+ Serial.println (F (" \t @ = toggle Wire - Wire1 - Wire2 [TEENSY 3.5 or Arduino Due ]" ));
254
254
Serial.println (F (" Scanmode:" ));
255
255
Serial.println (F (" \t s = single scan" ));
256
256
Serial.println (F (" \t c = continuous scan - 1 second delay" ));
@@ -295,15 +295,15 @@ void I2Cscan()
295
295
// TEST
296
296
// 0.1.04: tests only address range 8..120
297
297
// --------------------------------------------
298
- // Address R/W Bit Description
299
- // 0000 000 0 General call address
300
- // 0000 000 1 START byte
301
- // 0000 001 X CBUS address
302
- // 0000 010 X reserved - different bus format
303
- // 0000 011 X reserved - future purposes
304
- // 0000 1XX X High Speed master code
305
- // 1111 1XX X reserved - future purposes
306
- // 1111 0XX X 10-bit slave addressing
298
+ // Address R/W Bit Description
299
+ // 0000 000 0 General call address
300
+ // 0000 000 1 START byte
301
+ // 0000 001 X CBUS address
302
+ // 0000 010 X reserved - different bus format
303
+ // 0000 011 X reserved - future purposes
304
+ // 0000 1XX X High Speed master code
305
+ // 1111 1XX X reserved - future purposes
306
+ // 1111 0XX X 10-bit slave addressing
307
307
for (uint8_t address = addressStart; address <= addressEnd; address++)
308
308
{
309
309
bool printLine = printAll;
0 commit comments