Skip to content

Commit 366b1b8

Browse files
authored
Merge branch 'master' into patch-1
2 parents 0c5aa78 + 742abcd commit 366b1b8

File tree

11 files changed

+40
-42
lines changed

11 files changed

+40
-42
lines changed

cores/arduino/Arduino.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void yield(void);
112112
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
113113
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
114114
#define bitToggle(value, bit) ((value) ^= (1UL << (bit)))
115-
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
115+
#define bitWrite(value, bit, bitvalue) ((bitvalue) ? bitSet(value, bit) : bitClear(value, bit))
116116

117117
// avr-libc defines _NOP() since 1.6.2
118118
#ifndef _NOP
@@ -131,25 +131,25 @@ void initVariant(void);
131131

132132
int atexit(void (*func)()) __attribute__((weak));
133133

134-
void pinMode(uint8_t, uint8_t);
135-
void digitalWrite(uint8_t, uint8_t);
136-
int digitalRead(uint8_t);
137-
int analogRead(uint8_t);
134+
void pinMode(uint8_t pin, uint8_t mode);
135+
void digitalWrite(uint8_t pin, uint8_t val);
136+
int digitalRead(uint8_t pin);
137+
int analogRead(uint8_t pin);
138138
void analogReference(uint8_t mode);
139-
void analogWrite(uint8_t, int);
139+
void analogWrite(uint8_t pin, int val);
140140

141141
unsigned long millis(void);
142142
unsigned long micros(void);
143-
void delay(unsigned long);
143+
void delay(unsigned long ms);
144144
void delayMicroseconds(unsigned int us);
145145
unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout);
146146
unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout);
147147

148148
void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val);
149149
uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder);
150150

151-
void attachInterrupt(uint8_t, void (*)(void), int mode);
152-
void detachInterrupt(uint8_t);
151+
void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), int mode);
152+
void detachInterrupt(uint8_t interruptNum);
153153

154154
void setup(void);
155155
void loop(void);

cores/arduino/Stream.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ size_t Stream::readBytes(char *buffer, size_t length)
218218

219219
size_t Stream::readBytesUntil(char terminator, char *buffer, size_t length)
220220
{
221-
if (length < 1) return 0;
222221
size_t index = 0;
223222
while (index < length) {
224223
int c = timedRead();

cores/arduino/USBAPI.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ class USBDevice_
6565
void detach(); // Serial port goes down too...
6666
void poll();
6767
bool wakeupHost(); // returns false, when wakeup cannot be processed
68+
69+
bool isSuspended();
6870
};
6971
extern USBDevice_ USBDevice;
7072

cores/arduino/USBCore.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,14 +496,13 @@ bool SendConfiguration(int maxlen)
496496
static
497497
bool SendDescriptor(USBSetup& setup)
498498
{
499-
int ret;
500499
u8 t = setup.wValueH;
501500
if (USB_CONFIGURATION_DESCRIPTOR_TYPE == t)
502501
return SendConfiguration(setup.wLength);
503502

504503
InitControl(setup.wLength);
505504
#ifdef PLUGGABLE_USB_ENABLED
506-
ret = PluggableUSB().getDescriptor(setup);
505+
int ret = PluggableUSB().getDescriptor(setup);
507506
if (ret != 0) {
508507
return (ret > 0 ? true : false);
509508
}
@@ -855,4 +854,10 @@ bool USBDevice_::wakeupHost()
855854
return false;
856855
}
857856

857+
bool USBDevice_::isSuspended()
858+
{
859+
return (_usbSuspendState & (1 << SUSPI));
860+
}
861+
862+
858863
#endif /* if defined(USBCON) */

cores/arduino/WInterrupts.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ static volatile voidFuncPtr intFunc[EXTERNAL_NUM_INTERRUPTS] = {
6565
nothing,
6666
#endif
6767
};
68-
// volatile static voidFuncPtr twiIntFunc;
6968

7069
void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), int mode) {
7170
if(interruptNum < EXTERNAL_NUM_INTERRUPTS) {
@@ -274,11 +273,6 @@ void detachInterrupt(uint8_t interruptNum) {
274273
}
275274
}
276275

277-
/*
278-
void attachInterruptTwi(void (*userFunc)(void) ) {
279-
twiIntFunc = userFunc;
280-
}
281-
*/
282276

283277
#define IMPLEMENT_ISR(vect, interrupt) \
284278
ISR(vect) { \
@@ -314,11 +308,3 @@ IMPLEMENT_ISR(INT2_vect, EXTERNAL_INT_2)
314308
#endif
315309

316310
#endif
317-
318-
/*
319-
ISR(TWI_vect) {
320-
if(twiIntFunc)
321-
twiIntFunc();
322-
}
323-
*/
324-

cores/arduino/new.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ void *operator new[](size_t size) {
2626
return malloc(size);
2727
}
2828

29+
void * operator new(size_t size, void * ptr) noexcept {
30+
(void)size;
31+
return ptr;
32+
}
33+
2934
void operator delete(void * ptr) {
3035
free(ptr);
3136
}

cores/arduino/new.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
void * operator new(size_t size);
2525
void * operator new[](size_t size);
26+
void * operator new(size_t size, void * ptr) noexcept;
2627
void operator delete(void * ptr);
2728
void operator delete[](void * ptr);
2829

libraries/EEPROM/src/EEPROM.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct EERef{
4040

4141
//Access/read members.
4242
uint8_t operator*() const { return eeprom_read_byte( (uint8_t*) index ); }
43-
operator const uint8_t() const { return **this; }
43+
operator uint8_t() const { return **this; }
4444

4545
//Assignment/write members.
4646
EERef &operator=( const EERef &ref ) { return *this = *ref; }
@@ -89,7 +89,7 @@ struct EEPtr{
8989
EEPtr( const int index )
9090
: index( index ) {}
9191

92-
operator const int() const { return index; }
92+
operator int() const { return index; }
9393
EEPtr &operator=( int in ) { return index = in, *this; }
9494

9595
//Iterator functionality.
@@ -143,4 +143,4 @@ struct EEPROMClass{
143143
};
144144

145145
static EEPROMClass EEPROM;
146-
#endif
146+
#endif

libraries/SoftwareSerial/src/SoftwareSerial.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,4 @@ class SoftwareSerial : public Stream
111111
static inline void handle_interrupt() __attribute__((__always_inline__));
112112
};
113113

114-
// Arduino 0012 workaround
115-
#undef int
116-
#undef char
117-
#undef long
118-
#undef byte
119-
#undef float
120-
#undef abs
121-
#undef round
122-
123114
#endif

platform.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification
77

88
name=Arduino AVR Boards
9-
version=1.6.22
9+
version=1.6.23
1010

1111
# AVR compile variables
1212
# ---------------------
@@ -25,7 +25,7 @@ compiler.c.elf.flags={compiler.warning_flags} -Os -g -flto -fuse-linker-plugin -
2525
compiler.c.elf.cmd=avr-gcc
2626
compiler.S.flags=-c -g -x assembler-with-cpp -flto -MMD
2727
compiler.cpp.cmd=avr-g++
28-
compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto
28+
compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto
2929
compiler.ar.cmd=avr-gcc-ar
3030
compiler.ar.flags=rcs
3131
compiler.objcopy.cmd=avr-objcopy

programmers.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,22 @@ parallel.program.extra_params=-F
4343

4444
arduinoasisp.name=Arduino as ISP
4545
arduinoasisp.communication=serial
46-
arduinoasisp.protocol=arduino
46+
arduinoasisp.protocol=stk500v1
4747
arduinoasisp.speed=19200
48-
arduinoasisp.program.protocol=arduino
48+
arduinoasisp.program.protocol=stk500v1
4949
arduinoasisp.program.speed=19200
5050
arduinoasisp.program.tool=avrdude
5151
arduinoasisp.program.extra_params=-P{serial.port} -b{program.speed}
5252

53+
arduinoasispatmega32u4.name=Arduino as ISP (ATmega32U4)
54+
arduinoasispatmega32u4.communication=serial
55+
arduinoasispatmega32u4.protocol=arduino
56+
arduinoasispatmega32u4.speed=19200
57+
arduinoasispatmega32u4.program.protocol=arduino
58+
arduinoasispatmega32u4.program.speed=19200
59+
arduinoasispatmega32u4.program.tool=avrdude
60+
arduinoasispatmega32u4.program.extra_params=-P{serial.port} -b{program.speed}
61+
5362
usbGemma.name=Arduino Gemma
5463
usbGemma.protocol=arduinogemma
5564
usbGemma.program.tool=avrdude

0 commit comments

Comments
 (0)