Skip to content

Commit badf705

Browse files
author
rogerclarkmelbourne
committed
Removed BOARD_LED_PIN and button pin definitions as they are not core Arduino API definitions and they were causing confusion on users of generic stm32 boards which don't all have an LED and even if they have an LED, the pin it is on is not always on the same pin depending on the model of generic board
1 parent 4d3c370 commit badf705

48 files changed

Lines changed: 175 additions & 174 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

STM32F1/cores/maple/boards.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ extern const uint8 boardADCPins[];
7676
* @brief Pins which are connected to external hardware.
7777
*
7878
* For example, on Maple boards, it always at least includes
79-
* BOARD_LED_PIN. Its length is BOARD_NR_USED_PINS.
79+
* PB1 for the LED. Its length is BOARD_NR_USED_PINS.
8080
*/
8181
extern const uint8 boardUsedPins[];
8282

STM32F1/cores/maple/io.h

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -143,68 +143,7 @@ uint32 digitalRead(uint8 pin);
143143
* @see pinMode()
144144
*/
145145
uint16 analogRead(uint8 pin);
146-
#if FALSE
147-
// Roger Clark. Deprecated these functions as they are not part of the standard Arduino API
148146

149-
/**
150-
* Toggles the digital value at the given pin.
151-
*
152-
* The pin must have its mode set to OUTPUT.
153-
*
154-
* @param pin the pin to toggle. If the pin is HIGH, set it LOW. If
155-
* it is LOW, set it HIGH.
156-
*
157-
* @see pinMode()
158-
*/
159-
void togglePin(uint8 pin);
160-
161-
/**
162-
* Toggle the LED.
163-
*
164-
* If the LED is on, turn it off. If it is off, turn it on.
165-
*
166-
* The LED must its mode set to OUTPUT. This can be accomplished
167-
* portably over all LeafLabs boards by calling pinMode(BOARD_LED_PIN,
168-
* OUTPUT) before calling this function.
169-
*
170-
* @see pinMode()
171-
*/
172-
static inline void toggleLED() {
173-
togglePin(BOARD_LED_PIN);
174-
}
175-
176-
/**
177-
* If the button is currently pressed, waits until the button is no
178-
* longer being pressed, and returns true. Otherwise, returns false.
179-
*
180-
* The button pin must have its mode set to INPUT. This can be
181-
* accomplished portably over all LeafLabs boards by calling
182-
* pinMode(BOARD_BUTTON_PIN, INPUT).
183-
*
184-
* @see pinMode()
185-
*/
186-
uint8 isButtonPressed(uint8 pin=BOARD_BUTTON_PIN,
187-
uint32 pressedLevel=BOARD_BUTTON_PRESSED_LEVEL);
188-
189-
/**
190-
* Wait until the button is pressed and released, timing out if no
191-
* press occurs.
192-
*
193-
* The button pin must have its mode set to INPUT. This can be
194-
* accomplished portably over all LeafLabs boards by calling
195-
* pinMode(BOARD_BUTTON_PIN, INPUT).
196-
*
197-
* @param timeout_millis Number of milliseconds to wait until the
198-
* button is pressed. If timeout_millis is left out (or 0), wait
199-
* forever.
200-
*
201-
* @return true, if the button was pressed; false, if the timeout was
202-
* reached.
203-
*
204-
* @see pinMode()
205-
*/
206-
uint8 waitForButtonPress(uint32 timeout_millis=0);
207-
#endif
208147
/**
209148
* Shift out a byte of data, one bit at a time.
210149
*

STM32F1/libraries/Untested/RTClock/examples/Test_RTClock/Test_RTClock.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void blink () {
1111
}
1212

1313
void setup() {
14-
pinMode(BOARD_LED_PIN, OUTPUT);
14+
pinMode(PB1, OUTPUT);// Roger Clark. Updated for removal of LED pin as a global define (PB1 is Maple mini LED Pin)
1515

1616
rt.attachSecondsInterrupt(blink);
1717
}

STM32F1/variants/generic_stm32f103c/board.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,5 @@ extern const uint8 boardADCPins[BOARD_NR_ADC_PINS] __FLASH__ = {
107107

108108
// NOte. These definitions are not really used for generic boards, they only relate to boards modified to behave like Maple boards
109109
extern const uint8 boardUsedPins[BOARD_NR_USED_PINS] __FLASH__ = {
110-
BOARD_LED_PIN, BOARD_BUTTON_PIN, USB_DP, USB_DM
110+
USB_DP, USB_DM
111111
};

STM32F1/variants/generic_stm32f103c/board/board.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@
3939
#define CYCLES_PER_MICROSECOND 72
4040
#define SYSTICK_RELOAD_VAL 71999 /* takes a cycle to reload */
4141

42-
#define BOARD_BUTTON_PIN 32
43-
#define BOARD_LED_PIN 33
44-
4542
#define BOARD_NR_USARTS 3
4643
#define BOARD_USART1_TX_PIN PA9
4744
#define BOARD_USART1_RX_PIN PA10

STM32F1/variants/generic_stm32f103rxx/board.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,6 @@ extern const uint8 boardADCPins[BOARD_NR_ADC_PINS] __FLASH__ = {
145145

146146
/* not sure what this us used for */
147147
extern const uint8 boardUsedPins[BOARD_NR_USED_PINS] __FLASH__ = {
148-
BOARD_LED_PIN, BOARD_BUTTON_PIN, BOARD_JTMS_SWDIO_PIN,
148+
BOARD_JTMS_SWDIO_PIN,
149149
BOARD_JTCK_SWCLK_PIN, BOARD_JTDI_PIN, BOARD_JTDO_PIN, BOARD_NJTRST_PIN
150150
};

STM32F1/variants/generic_stm32f103rxx/board/board.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@
4141
#define CYCLES_PER_MICROSECOND 72
4242
#define SYSTICK_RELOAD_VAL 71999 /* takes a cycle to reload */
4343

44-
#define BOARD_BUTTON_PIN 38
45-
#define BOARD_LED_PIN 13
46-
4744
// USARTS
4845
#define BOARD_NR_USARTS 5
4946
#define BOARD_USART1_TX_PIN PA9

STM32F1/variants/generic_stm32f103zxx/board.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,6 @@ extern const uint8 boardADCPins[BOARD_NR_ADC_PINS] __FLASH__ = {
210210

211211
/* not sure what this us used for */
212212
extern const uint8 boardUsedPins[BOARD_NR_USED_PINS] __FLASH__ = {
213-
BOARD_LED_PIN, BOARD_BUTTON_PIN, BOARD_JTMS_SWDIO_PIN,
213+
BOARD_JTMS_SWDIO_PIN,
214214
BOARD_JTCK_SWCLK_PIN, BOARD_JTDI_PIN, BOARD_JTDO_PIN, BOARD_NJTRST_PIN
215215
};

STM32F1/variants/generic_stm32f103zxx/board/board.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@
4141
#define CYCLES_PER_MICROSECOND 72
4242
#define SYSTICK_RELOAD_VAL 71999 /* takes a cycle to reload */
4343

44-
#define BOARD_BUTTON_PIN 38
45-
#define BOARD_LED_PIN 13
46-
4744
// USARTS
4845
#define BOARD_NR_USARTS 5
4946
#define BOARD_USART1_TX_PIN PA9

STM32F1/variants/maple/board.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,6 @@ extern const uint8 boardADCPins[] __FLASH__ = {
138138
// the button and the LED, it's usually best to leave these pins alone
139139
// unless you know what you're doing.
140140
extern const uint8 boardUsedPins[] __FLASH__ = {
141-
BOARD_LED_PIN, BOARD_BUTTON_PIN, BOARD_JTMS_SWDIO_PIN,
141+
13, 33, BOARD_JTMS_SWDIO_PIN,
142142
BOARD_JTCK_SWCLK_PIN, BOARD_JTDI_PIN, BOARD_JTDO_PIN, BOARD_NJTRST_PIN
143143
};

0 commit comments

Comments
 (0)