summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2016-06-14 23:37:01 +0200
committerChristian Pointner <equinox@spreadspace.org>2016-06-14 23:37:01 +0200
commita76b2585e8957e2cb4307f1c0c5fee4a1d279d5a (patch)
tree0fb3b8100a70a09ef16de34e56351dad60ef73dc
parentremove float printf for usb-led example (diff)
led lib for arduino uno and arduinoProMicro (from SparkFun)
-rw-r--r--lib/led.c21
-rwxr-xr-xtools/reset_sparkfun2
-rw-r--r--usb-bmp280/Makefile2
-rw-r--r--usb-led/usb-led.c3
4 files changed, 22 insertions, 6 deletions
diff --git a/lib/led.c b/lib/led.c
index 921cf25..d6e57d0 100644
--- a/lib/led.c
+++ b/lib/led.c
@@ -24,10 +24,12 @@
#include "led.h"
-#if defined(__BOARD_minimus__) || defined(__BOARD_minimus32__)
+
+#if defined(__BOARD_minimus__) || defined(__BOARD_minimus32__) || defined(__BOARD_arduinoProMicro__)
#define NUM_LEDS 2
#elif defined(__BOARD_teensy1__) || defined(__BOARD_teensy1pp__) || defined(__BOARD_teensy2__) || defined(__BOARD_teensy2pp__) || \
- defined(__BOARD_arduinoNano__) || defined(__BOARD_arduinoNG__) || defined(__BOARD_arduino2009v2__) || defined(__BOARD_arduino2009__) || defined(__BOARD_arduino10000__) || \
+ defined(__BOARD_arduinoNano__) || defined(__BOARD_arduinoNG__) || defined(__BOARD_arduino2009v2__) || defined(__BOARD_arduino2009__) || \
+ defined(__BOARD_arduino10000__) || defined(__BOARD_arduinoUno__) || \
defined(__BOARD_hhd70dongle__) || defined(__BOARD_rda1846dongle__) || defined(__BOARD_culV3__) || \
defined(__BOARD_slowpandongle1__) || defined(__BOARD_slowpandongle2__) || defined(__BOARD_teenstep__) || \
defined(__BOARD_rhmixxx__)
@@ -37,7 +39,7 @@
#endif
#if defined(__BOARD_teensy1__) || defined(__BOARD_teensy1pp__) || defined(__BOARD_minimus__) || defined(__BOARD_minimus32__) || \
- defined(__BOARD_rhmixxx__)
+ defined(__BOARD_rhmixxx__) || defined(__BOARD_arduinoProMicro__)
#define LED_DIR 0
#else
#define LED_DIR 1
@@ -60,6 +62,16 @@
#define LED2_PINNUM 6
#endif
+#if defined(__BOARD_arduinoProMicro__)
+#define LED_PORT PORTD
+#define LED_DDR DDRD
+#define LED_PINNUM 5
+
+#define LED2_PORT PORTB
+#define LED2_DDR DDRB
+#define LED2_PINNUM 0
+#endif
+
#if defined(__BOARD_slowpandongle2__) || defined(__BOARD_hhd70dongle__) || defined(__BOARD_rda1846dongle__) || defined(__BOARD_culV3__)
#define LED_PORT PORTE
#define LED_DDR DDRE
@@ -72,7 +84,8 @@
#define LED_PINNUM 2
#endif
-#if defined(__BOARD_arduinoNano__) || defined(__BOARD_arduino2009v2__) || defined(__BOARD_arduino2009__) || defined(__BOARD_arduino10000__) || defined(__BOARD_arduinoNG__)
+#if defined(__BOARD_arduinoNano__) || defined(__BOARD_arduino2009v2__) || defined(__BOARD_arduino2009__) || defined(__BOARD_arduino10000__) || \
+ defined(__BOARD_arduinoNG__) || defined(__BOARD_arduinoUno__)
#define LED_PORT PORTB
#define LED_DDR DDRB
#define LED_PINNUM 5
diff --git a/tools/reset_sparkfun b/tools/reset_sparkfun
index 62884b0..3509d78 100755
--- a/tools/reset_sparkfun
+++ b/tools/reset_sparkfun
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#(c) Bernhard Tittelbach
if [ -z "$1" ]; then
diff --git a/usb-bmp280/Makefile b/usb-bmp280/Makefile
index d0c6322..754ec08 100644
--- a/usb-bmp280/Makefile
+++ b/usb-bmp280/Makefile
@@ -24,7 +24,7 @@
NAME := usb-bmp280
BOARD_TYPE := arduinoProMicro
OBJ := $(NAME).o
-LIBS := util led lufa-descriptor-usbserial usbio bmp280
+LIBS := util lufa-descriptor-usbserial usbio bmp280
EXTERNAL_LIBS := lufa
SPREADAVR_PATH := ..
PRINTF_HAS_FLOAT := 1
diff --git a/usb-led/usb-led.c b/usb-led/usb-led.c
index 350e091..3378435 100644
--- a/usb-led/usb-led.c
+++ b/usb-led/usb-led.c
@@ -37,6 +37,9 @@ void handle_cmd(uint8_t cmd)
case '0': led_off(); break;
case '1': led_on(); break;
case 't': led_toggle(); break;
+ case 'o': led2_off(); break;
+ case 'i': led2_on(); break;
+ case 'T': led2_toggle(); break;
case 'r': reset2bootloader(); break;
default: printf("error\r\n"); return;
}