Skip to content

Commit a5ad983

Browse files
committed
Merge remote-tracking branch 'upstream/master'
* upstream/master: (1840 commits) Changed pins definition in variants from constants to #defines. update AdvancedChatServer.ino, add operator!= remove all Changes besides operator== apply AdvancedChatServer.ino changes to renamed ChatServer.ino revert Chatserver example, create new AdvancedChatServer based on it add some lines of comment to ChatServer.ino, remove redundant assignment of Client-instance add localPort to EthernetClient, simplify operator== add operator==, remoteIP and remotePort to EthernetClient Fix SERIAL_* metadata in Arduino Ethernet variant Updated KeyboardMessage example Modified LCD custom character example Updated Blink without delay example Updated listfiles SD example Added SERIAL metadata into variant files. Updates to a number of Examples Fix robot problems regarding new version of Arduino Help 3rd party installers find the hardware path Changed LED_BUILTIN to a macro to better support boards that do not have a built-in LED. Added LED_BUILTIN constant to Leonardo board Added Arduino Ethernet variant. ... Conflicts: hardware/arduino/cores/arduino/Arduino.h hardware/arduino/cores/arduino/wiring.c hardware/arduino/variants/ethernet/pins_arduino.h hardware/arduino/variants/leonardo/pins_arduino.h hardware/arduino/variants/mega/pins_arduino.h hardware/arduino/variants/robot_control/pins_arduino.h hardware/arduino/variants/robot_motor/pins_arduino.h hardware/arduino/variants/standard/pins_arduino.h libraries/Ethernet/Dhcp.cpp libraries/Ethernet/EthernetClient.cpp libraries/Ethernet/EthernetClient.h libraries/GSM/GSM3ShieldV1.cpp libraries/GSM/GSM3ShieldV1DirectModemProvider.cpp libraries/SD/utility/Sd2Card.cpp
2 parents ad0d280 + 3baa0ce commit a5ad983

File tree

12 files changed

+262
-146
lines changed

12 files changed

+262
-146
lines changed

build/windows/jre.zip

38.7 MB
Binary file not shown.

hardware/arduino/variants/ethernet/pins_arduino.h

+14-14
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@
3737
#define digitalPinHasPWM(p) ((p) == 3 || (p) == 5 || (p) == 6 || (p) == 9 || (p) == 10 || (p) == 11)
3838
#endif
3939

40-
static const uint8_t SS = 10;
41-
static const uint8_t MOSI = 11;
42-
static const uint8_t MISO = 12;
43-
static const uint8_t SCK = 13;
40+
#define SS 10
41+
#define MOSI 11
42+
#define MISO 12
43+
#define SCK 13
4444

45-
static const uint8_t SDA = 18;
46-
static const uint8_t SCL = 19;
45+
#define SDA 18
46+
#define SCL 19
4747
#define LED_BUILTIN 9
4848

49-
static const uint8_t A0 = 14;
50-
static const uint8_t A1 = 15;
51-
static const uint8_t A2 = 16;
52-
static const uint8_t A3 = 17;
53-
static const uint8_t A4 = 18;
54-
static const uint8_t A5 = 19;
55-
static const uint8_t A6 = 20;
56-
static const uint8_t A7 = 21;
49+
#define A0 14
50+
#define A1 15
51+
#define A2 16
52+
#define A3 17
53+
#define A4 18
54+
#define A5 19
55+
#define A6 20
56+
#define A7 21
5757

5858
#define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 21) ? (&PCICR) : ((uint8_t *)0))
5959
#define digitalPinToPCICRbit(p) (((p) <= 7) ? 2 : (((p) <= 13) ? 0 : 1))

hardware/arduino/variants/leonardo/pins_arduino.h

+18-18
Original file line numberDiff line numberDiff line change
@@ -99,30 +99,30 @@
9999
#define RXLED0 PORTB |= (1<<0)
100100
#define RXLED1 PORTB &= ~(1<<0)
101101

102-
static const uint8_t SDA = 2;
103-
static const uint8_t SCL = 3;
102+
#define SDA 2
103+
#define SCL 3
104104
#define LED_BUILTIN 13
105105

106106
// Map SPI port to 'new' pins D14..D17
107-
static const uint8_t SS = 17;
108-
static const uint8_t MOSI = 16;
109-
static const uint8_t MISO = 14;
110-
static const uint8_t SCK = 15;
107+
#define SS 17
108+
#define MOSI 16
109+
#define MISO 14
110+
#define SCK 15
111111

112112
// Mapping of analog pins as digital I/O
113113
// A6-A11 share with digital pins
114-
static const uint8_t A0 = 18;
115-
static const uint8_t A1 = 19;
116-
static const uint8_t A2 = 20;
117-
static const uint8_t A3 = 21;
118-
static const uint8_t A4 = 22;
119-
static const uint8_t A5 = 23;
120-
static const uint8_t A6 = 24; // D4
121-
static const uint8_t A7 = 25; // D6
122-
static const uint8_t A8 = 26; // D8
123-
static const uint8_t A9 = 27; // D9
124-
static const uint8_t A10 = 28; // D10
125-
static const uint8_t A11 = 29; // D12
114+
#define A0 18
115+
#define A1 19
116+
#define A2 20
117+
#define A3 21
118+
#define A4 22
119+
#define A5 23
120+
#define A6 24 // D4
121+
#define A7 25 // D6
122+
#define A8 26 // D8
123+
#define A9 27 // D9
124+
#define A10 28 // D10
125+
#define A11 29 // D12
126126

127127
#define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0))
128128
#define digitalPinToPCICRbit(p) 0

hardware/arduino/variants/mega/pins_arduino.h

+22-22
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,31 @@
3232
#define analogInputToDigitalPin(p) ((p < 16) ? (p) + 54 : -1)
3333
#define digitalPinHasPWM(p) (((p) >= 2 && (p) <= 13) || ((p) >= 44 && (p)<= 46))
3434

35-
static const uint8_t SS = 53;
36-
static const uint8_t MOSI = 51;
37-
static const uint8_t MISO = 50;
38-
static const uint8_t SCK = 52;
35+
#define SS 53
36+
#define MOSI 51
37+
#define MISO 50
38+
#define SCK 52
3939

40-
static const uint8_t SDA = 20;
41-
static const uint8_t SCL = 21;
40+
#define SDA 20
41+
#define SCL 21
4242
#define LED_BUILTIN 13
4343

44-
static const uint8_t A0 = 54;
45-
static const uint8_t A1 = 55;
46-
static const uint8_t A2 = 56;
47-
static const uint8_t A3 = 57;
48-
static const uint8_t A4 = 58;
49-
static const uint8_t A5 = 59;
50-
static const uint8_t A6 = 60;
51-
static const uint8_t A7 = 61;
52-
static const uint8_t A8 = 62;
53-
static const uint8_t A9 = 63;
54-
static const uint8_t A10 = 64;
55-
static const uint8_t A11 = 65;
56-
static const uint8_t A12 = 66;
57-
static const uint8_t A13 = 67;
58-
static const uint8_t A14 = 68;
59-
static const uint8_t A15 = 69;
44+
#define A0 54
45+
#define A1 55
46+
#define A2 56
47+
#define A3 57
48+
#define A4 58
49+
#define A5 59
50+
#define A6 60
51+
#define A7 61
52+
#define A8 62
53+
#define A9 63
54+
#define A10 64
55+
#define A11 65
56+
#define A12 66
57+
#define A13 67
58+
#define A14 68
59+
#define A15 69
6060

6161
// A majority of the pins are NOT PCINTs, SO BE WARNED (i.e. you cannot use them as receive pins)
6262
// Only pins available for RECEIVE (TRANSMIT can be on any pin):

hardware/arduino/variants/robot_control/pins_arduino.h

+39-39
Original file line numberDiff line numberDiff line change
@@ -43,52 +43,52 @@
4343
#define D4 TKD4
4444
#define D5 TKD5
4545

46-
static const uint8_t RX = 0;
47-
static const uint8_t TX = 1;
48-
static const uint8_t SDA = 2;
49-
static const uint8_t SCL = 3;
46+
#define RX 0
47+
#define TX 1
48+
#define SDA 2
49+
#define SCL 3
5050

5151
// Map SPI port to 'new' pins D14..D17
52-
static const uint8_t SS = 17;
53-
static const uint8_t MOSI = 16;
54-
static const uint8_t MISO = 14;
55-
static const uint8_t SCK = 15;
52+
#define SS 17
53+
#define MOSI 16
54+
#define MISO 14
55+
#define SCK 15
5656

5757
// Mapping of analog pins as digital I/O
5858
// A6-A11 share with digital pins
59-
static const uint8_t A0 = 18;
60-
static const uint8_t A1 = 19;
61-
static const uint8_t A2 = 20;
62-
static const uint8_t A3 = 21;
63-
static const uint8_t A4 = 22;
64-
static const uint8_t A5 = 23;
65-
static const uint8_t A6 = 24; // D4
66-
static const uint8_t A7 = 25; // D6
67-
static const uint8_t A8 = 26; // D8
68-
static const uint8_t A9 = 27; // D9
69-
static const uint8_t A10 = 28; // D10
70-
static const uint8_t A11 = 29; // D12
59+
#define A0 18
60+
#define A1 19
61+
#define A2 20
62+
#define A3 21
63+
#define A4 22
64+
#define A5 23
65+
#define A6 24 // D4
66+
#define A7 25 // D6
67+
#define A8 26 // D8
68+
#define A9 27 // D9
69+
#define A10 28 // D10
70+
#define A11 29 // D12
7171

7272
// Specific Mapping for the Control Board
73-
static const uint8_t KEY = 18; // AD0
74-
static const uint8_t MUX_IN = 24; // ADC8 - A6
75-
static const uint8_t MUXA = 6; // D5 - TKD4
76-
static const uint8_t MUXB = 11; // D11
77-
static const uint8_t MUXC = 12; // D12 - TKD5
78-
static const uint8_t MUXD = 13; // D13
79-
static const uint8_t BUZZ = 5; // D5
80-
static const uint8_t POT = 23; // AD5
81-
static const uint8_t DC_LCD = 10; // D10
82-
static const uint8_t LCD_CS = 9; // D9
83-
static const uint8_t RST_LCD = 7; // D6
84-
static const uint8_t CARD_CS = 8; // D8
85-
static const uint8_t TKD0 = 19; // ADC6 - A1
86-
static const uint8_t TKD1 = 20; // ADC5 - A2
87-
static const uint8_t TKD2 = 21; // ADC4 - A3
88-
static const uint8_t TKD3 = 22; // ADC1 - A4
89-
static const uint8_t TKD4 = 6; // D5 - MUXA
90-
static const uint8_t TKD5 = 12; // D12 - MUXC
91-
static const uint8_t LED1 = 17; // D17 - RX_Led
73+
#define KEY 18 // AD0
74+
#define MUX_IN 24 // ADC8 - A6
75+
#define MUXA 6 // D5 - TKD4
76+
#define MUXB 11 // D11
77+
#define MUXC 12 // D12 - TKD5
78+
#define MUXD 13 // D13
79+
#define BUZZ 5 // D5
80+
#define POT 23 // AD5
81+
#define DC_LCD 10 // D10
82+
#define LCD_CS 9 // D9
83+
#define RST_LCD 7 // D6
84+
#define CARD_CS 8 // D8
85+
#define TKD0 19 // ADC6 - A1
86+
#define TKD1 20 // ADC5 - A2
87+
#define TKD2 21 // ADC4 - A3
88+
#define TKD3 22 // ADC1 - A4
89+
#define TKD4 6 // D5 - MUXA
90+
#define TKD5 12 // D12 - MUXC
91+
#define LED1 17 // D17 - RX_Led
9292

9393
// __AVR_ATmega32U4__ has an unusual mapping of pins to channels
9494
extern const uint8_t PROGMEM analog_pin_to_channel_PGM[];

hardware/arduino/variants/robot_motor/pins_arduino.h

+36-36
Original file line numberDiff line numberDiff line change
@@ -41,49 +41,49 @@
4141
#define D8 TK4
4242
#define D7 TK3
4343

44-
static const uint8_t RX = 0;
45-
static const uint8_t TX = 1;
46-
static const uint8_t SDA = 2;
47-
static const uint8_t SCL = 3;
44+
#define RX 0
45+
#define TX 1
46+
#define SDA 2
47+
#define SCL 3
4848

4949
// Map SPI port to 'new' pins D14..D17
50-
static const uint8_t SS = 17;
51-
static const uint8_t MOSI = 16;
52-
static const uint8_t MISO = 14;
53-
static const uint8_t SCK = 15;
50+
#define SS 17
51+
#define MOSI 16
52+
#define MISO 14
53+
#define SCK 15
5454

5555
// Mapping of analog pins as digital I/O
5656
// A6-A11 share with digital pins
57-
static const uint8_t A0 = 18;
58-
static const uint8_t A1 = 19;
59-
static const uint8_t A2 = 20;
60-
static const uint8_t A3 = 21;
61-
static const uint8_t A4 = 22;
62-
static const uint8_t A5 = 23;
63-
static const uint8_t A6 = 24; // D4
64-
static const uint8_t A7 = 25; // D6
65-
static const uint8_t A8 = 26; // D8
66-
static const uint8_t A9 = 27; // D9
67-
static const uint8_t A10 = 28; // D10
68-
static const uint8_t A11 = 29; // D12
57+
#define A0 18
58+
#define A1 19
59+
#define A2 20
60+
#define A3 21
61+
#define A4 22
62+
#define A5 23
63+
#define A6 24 // D4
64+
#define A7 25 // D6
65+
#define A8 26 // D8
66+
#define A9 27 // D9
67+
#define A10 28 // D10
68+
#define A11 29 // D12
6969

7070
// Specific Mapping for the Motor Board
71-
static const uint8_t MUX_IN = 20; // A2
72-
static const uint8_t MUXA = 7; // D7
73-
static const uint8_t MUXB = 8; // D8
74-
static const uint8_t MUXC = 11; // D11
75-
static const uint8_t MUXI = 13; // D13
76-
static const uint8_t TRIM = 21; // A3
77-
static const uint8_t SENSE_A = 22; // A4
78-
static const uint8_t SENSE_B = 23; // A5
79-
static const uint8_t IN_A1 = 6; // D6 - A7
80-
static const uint8_t IN_A2 = 5; // D5
81-
static const uint8_t IN_B1 = 10; // D10
82-
static const uint8_t IN_B2 = 9; // D9
83-
static const uint8_t TK1 = 18; // A0
84-
static const uint8_t TK2 = 19; // A1
85-
static const uint8_t TK3 = 4; // A6
86-
static const uint8_t TK4 = 12; // A11
71+
#define MUX_IN 20 // A2
72+
#define MUXA 7 // D7
73+
#define MUXB 8 // D8
74+
#define MUXC 11 // D11
75+
#define MUXI 13 // D13
76+
#define TRIM 21 // A3
77+
#define SENSE_A 22 // A4
78+
#define SENSE_B 23 // A5
79+
#define IN_A1 6 // D6 - A7
80+
#define IN_A2 5 // D5
81+
#define IN_B1 10 // D10
82+
#define IN_B2 9 // D9
83+
#define TK1 18 // A0
84+
#define TK2 19 // A1
85+
#define TK3 4 // A6
86+
#define TK4 12 // A11
8787

8888
// __AVR_ATmega32U4__ has an unusual mapping of pins to channels
8989
extern const uint8_t PROGMEM analog_pin_to_channel_PGM[];

hardware/arduino/variants/standard/pins_arduino.h

+14-14
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@
3737
#define digitalPinHasPWM(p) ((p) == 3 || (p) == 5 || (p) == 6 || (p) == 9 || (p) == 10 || (p) == 11)
3838
#endif
3939

40-
static const uint8_t SS = 10;
41-
static const uint8_t MOSI = 11;
42-
static const uint8_t MISO = 12;
43-
static const uint8_t SCK = 13;
40+
#define SS 10
41+
#define MOSI 11
42+
#define MISO 12
43+
#define SCK 13
4444

45-
static const uint8_t SDA = 18;
46-
static const uint8_t SCL = 19;
45+
#define SDA 18
46+
#define SCL 19
4747
#define LED_BUILTIN 13
4848

49-
static const uint8_t A0 = 14;
50-
static const uint8_t A1 = 15;
51-
static const uint8_t A2 = 16;
52-
static const uint8_t A3 = 17;
53-
static const uint8_t A4 = 18;
54-
static const uint8_t A5 = 19;
55-
static const uint8_t A6 = 20;
56-
static const uint8_t A7 = 21;
49+
#define A0 14
50+
#define A1 15
51+
#define A2 16
52+
#define A3 17
53+
#define A4 18
54+
#define A5 19
55+
#define A6 20
56+
#define A7 21
5757

5858
#define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 21) ? (&PCICR) : ((uint8_t *)0))
5959
#define digitalPinToPCICRbit(p) (((p) <= 7) ? 2 : (((p) <= 13) ? 0 : 1))

libraries/Ethernet/Dhcp.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ uint8_t DhcpClass::parseDHCPResponse(unsigned long responseTimeout, uint32_t& tr
283283
RIP_MSG_FIXED fixedMsg;
284284
_dhcpUdpSocket.read((uint8_t*)&fixedMsg, sizeof(RIP_MSG_FIXED));
285285

286+
286287
if(fixedMsg.op == DHCP_BOOTREPLY && _dhcpUdpSocket.remotePort() == DHCP_SERVER_PORT)
287288
{
288289
transactionId = ntohl(fixedMsg.xid);
@@ -303,12 +304,12 @@ uint8_t DhcpClass::parseDHCPResponse(unsigned long responseTimeout, uint32_t& tr
303304
_dhcpUdpSocket.read(); // we don't care about the returned byte
304305
}
305306

306-
while (_dhcpUdpSocket.available() > 0)
307+
while (_dhcpUdpSocket.available() > 0)
307308
{
308309
#ifdef VERILITE_WDT_MODS
309310
wdt_reset (); // watchdog reset
310-
#endif
311-
switch (_dhcpUdpSocket.read())
311+
#endif
312+
switch (_dhcpUdpSocket.read())
312313
{
313314
case endOption :
314315
break;

libraries/Ethernet/EthernetClient.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,7 @@ uint8_t EthernetClient::status() {
182182
EthernetClient::operator bool() {
183183
return _sock != MAX_SOCK_NUM;
184184
}
185+
186+
bool EthernetClient::operator==(const EthernetClient& rhs) {
187+
return _sock == rhs._sock && _sock != MAX_SOCK_NUM && rhs._sock != MAX_SOCK_NUM;
188+
}

libraries/Ethernet/EthernetClient.h

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class EthernetClient : public Client {
2424
virtual void stop();
2525
virtual uint8_t connected();
2626
virtual operator bool();
27+
virtual bool operator==(const EthernetClient&);
28+
virtual bool operator!=(const EthernetClient& rhs) { return !this->operator==(rhs); };
2729

2830
friend class EthernetServer;
2931

0 commit comments

Comments
 (0)