aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cores/arduino/Arduino.h30
-rw-r--r--cores/arduino/main.cpp7
-rw-r--r--cores/arduino/wiring_analog.c8
-rw-r--r--cores/arduino/wiring_digital.c3
-rw-r--r--firmwares/arduinoISP/readme.txt5
-rwxr-xr-xfirmwares/wifishield/scripts/ArduinoWifiShield_upgrade.sh2
-rwxr-xr-x[-rw-r--r--]firmwares/wifishield/scripts/ArduinoWifiShield_upgrade_mac.sh2
-rw-r--r--platform.txt6
-rw-r--r--programmers.txt21
9 files changed, 57 insertions, 27 deletions
diff --git a/cores/arduino/Arduino.h b/cores/arduino/Arduino.h
index ec1389e..630f0d6 100644
--- a/cores/arduino/Arduino.h
+++ b/cores/arduino/Arduino.h
@@ -118,6 +118,7 @@ typedef uint8_t boolean;
typedef uint8_t byte;
void init(void);
+void initVariant(void);
void pinMode(uint8_t, uint8_t);
void digitalWrite(uint8_t, uint8_t);
@@ -194,20 +195,21 @@ extern const uint8_t PROGMEM digital_pin_to_timer_PGM[];
#define TIMER0B 2
#define TIMER1A 3
#define TIMER1B 4
-#define TIMER2 5
-#define TIMER2A 6
-#define TIMER2B 7
-
-#define TIMER3A 8
-#define TIMER3B 9
-#define TIMER3C 10
-#define TIMER4A 11
-#define TIMER4B 12
-#define TIMER4C 13
-#define TIMER4D 14
-#define TIMER5A 15
-#define TIMER5B 16
-#define TIMER5C 17
+#define TIMER1C 5
+#define TIMER2 6
+#define TIMER2A 7
+#define TIMER2B 8
+
+#define TIMER3A 9
+#define TIMER3B 10
+#define TIMER3C 11
+#define TIMER4A 12
+#define TIMER4B 13
+#define TIMER4C 14
+#define TIMER4D 15
+#define TIMER5A 16
+#define TIMER5B 17
+#define TIMER5C 18
#ifdef __cplusplus
} // extern "C"
diff --git a/cores/arduino/main.cpp b/cores/arduino/main.cpp
index 0ad6962..091c365 100644
--- a/cores/arduino/main.cpp
+++ b/cores/arduino/main.cpp
@@ -19,10 +19,17 @@
#include <Arduino.h>
+// Weak empty variant initialization function.
+// May be redefined by variant files.
+void initVariant() __attribute__((weak));
+void initVariant() { }
+
int main(void)
{
init();
+ initVariant();
+
#if defined(USBCON)
USBDevice.attach();
#endif
diff --git a/cores/arduino/wiring_analog.c b/cores/arduino/wiring_analog.c
index 8feead9..48a9ef5 100644
--- a/cores/arduino/wiring_analog.c
+++ b/cores/arduino/wiring_analog.c
@@ -160,6 +160,14 @@ void analogWrite(uint8_t pin, int val)
break;
#endif
+ #if defined(TCCR1A) && defined(COM1C1)
+ case TIMER1C:
+ // connect pwm to pin on timer 1, channel B
+ sbi(TCCR1A, COM1C1);
+ OCR1C = val; // set pwm duty
+ break;
+ #endif
+
#if defined(TCCR2) && defined(COM21)
case TIMER2:
// connect pwm to pin on timer 2
diff --git a/cores/arduino/wiring_digital.c b/cores/arduino/wiring_digital.c
index be323b1..df94cc1 100644
--- a/cores/arduino/wiring_digital.c
+++ b/cores/arduino/wiring_digital.c
@@ -84,6 +84,9 @@ static void turnOffPWM(uint8_t timer)
#if defined(TCCR1A) && defined(COM1B1)
case TIMER1B: cbi(TCCR1A, COM1B1); break;
#endif
+ #if defined(TCCR1A) && defined(COM1C1)
+ case TIMER1C: cbi(TCCR1A, COM1C1); break;
+ #endif
#if defined(TCCR2) && defined(COM21)
case TIMER2: cbi(TCCR2, COM21); break;
diff --git a/firmwares/arduinoISP/readme.txt b/firmwares/arduinoISP/readme.txt
new file mode 100644
index 0000000..a150f96
--- /dev/null
+++ b/firmwares/arduinoISP/readme.txt
@@ -0,0 +1,5 @@
+
+You can download the ArduinoISP firmware source files from:
+
+https://github.com/arduino/ArduinoISP
+
diff --git a/firmwares/wifishield/scripts/ArduinoWifiShield_upgrade.sh b/firmwares/wifishield/scripts/ArduinoWifiShield_upgrade.sh
index d9a9e02..e3a7d7f 100755
--- a/firmwares/wifishield/scripts/ArduinoWifiShield_upgrade.sh
+++ b/firmwares/wifishield/scripts/ArduinoWifiShield_upgrade.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-WIFI_FW_PATH="/hardware/arduino/firmwares/wifishield/binary"
+WIFI_FW_PATH="/hardware/arduino/avr/firmwares/wifishield/binary"
AVR_TOOLS_PATH="/hardware/tools/avr/bin"
TARGET_MICRO="at32uc3a1256"
diff --git a/firmwares/wifishield/scripts/ArduinoWifiShield_upgrade_mac.sh b/firmwares/wifishield/scripts/ArduinoWifiShield_upgrade_mac.sh
index 5082392..dadaf29 100644..100755
--- a/firmwares/wifishield/scripts/ArduinoWifiShield_upgrade_mac.sh
+++ b/firmwares/wifishield/scripts/ArduinoWifiShield_upgrade_mac.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-WIFI_FW_PATH="/hardware/arduino/firmwares/wifi-shield"
+WIFI_FW_PATH="/hardware/arduino/avr/firmwares/wifishield/binary"
AVR_TOOLS_PATH="/hardware/tools/avr/bin"
progname=$0
diff --git a/platform.txt b/platform.txt
index d81aef6..66257ef 100644
--- a/platform.txt
+++ b/platform.txt
@@ -14,14 +14,14 @@ version=1.5.6
# Default "compiler.path" is correct, change only if you want to overidde the initial value
compiler.path={runtime.ide.path}/hardware/tools/avr/bin/
compiler.c.cmd=avr-gcc
-compiler.c.flags=-c -g -Os -w -ffunction-sections -fdata-sections -MMD -flto
+compiler.c.flags=-c -g -Os -w -ffunction-sections -fdata-sections -MMD
# -w flag added to avoid printing a wrong warning http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59396
# This is fixed in gcc 4.8.3 and will be removed as soon as we update the toolchain
-compiler.c.elf.flags=-w -flto -Os -Wl,--gc-sections
+compiler.c.elf.flags=-w -Os -Wl,--gc-sections
compiler.c.elf.cmd=avr-gcc
compiler.S.flags=-c -g -x assembler-with-cpp
compiler.cpp.cmd=avr-g++
-compiler.cpp.flags=-c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -flto
+compiler.cpp.flags=-c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD
compiler.ar.cmd=avr-ar
compiler.ar.flags=rcs
compiler.objcopy.cmd=avr-objcopy
diff --git a/programmers.txt b/programmers.txt
index 54c04e7..a553bde 100644
--- a/programmers.txt
+++ b/programmers.txt
@@ -17,6 +17,11 @@ usbtinyisp.protocol=usbtiny
usbtinyisp.program.tool=avrdude
usbtinyisp.program.extra_params=
+arduinoisp.name=ArduinoISP
+arduinoisp.protocol=arduinoisp
+arduinoisp.program.tool=avrdude
+arduinoisp.program.extra_params=
+
usbasp.name=USBasp
usbasp.communication=usb
usbasp.protocol=usbasp
@@ -31,11 +36,11 @@ parallel.force=true
parallel.program.tool=avrdude
parallel.program.extra_params=-F
-arduinoisp.name=Arduino as ISP
-arduinoisp.communication=serial
-arduinoisp.protocol=stk500v1
-arduinoisp.speed=19200
-arduinoisp.program.protocol=stk500v1
-arduinoisp.program.speed=19200
-arduinoisp.program.tool=avrdude
-arduinoisp.program.extra_params=-P{serial.port} -b{program.speed}
+arduinoasisp.name=Arduino as ISP
+arduinoasisp.communication=serial
+arduinoasisp.protocol=stk500v1
+arduinoasisp.speed=19200
+arduinoasisp.program.protocol=stk500v1
+arduinoasisp.program.speed=19200
+arduinoasisp.program.tool=avrdude
+arduinoasisp.program.extra_params=-P{serial.port} -b{program.speed}