Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

void-ed unused function parameters #13

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 3 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,75 +1,5 @@
# Arduino Core for STM32L4 based boards
# Arduino Core for STM32L4 Ladybug Flight Controller

## Supported boards

### Tlera Corp
* [Dragonfly-STM32L476RE](https://www.tindie.com/products/TleraCorp/dragonfly-stm32l476-development-board)
* [Butterfly-STM32L433CC](https://www.tindie.com/products/TleraCorp/butterfly-stm32l433-development-board)
* [Ladybug-STM32L432KC](https://www.tindie.com/products/TleraCorp/ladybug-stm32l432-development-board)

### STMicroelectronics
* NUCLEO-L432
* NUCLEO-L476

## Installing

### Board Manager

1. [Download and install the Arduino IDE](https://www.arduino.cc/en/Main/Software) (at least version v1.6.8)
2. Start the Arduino IDE
3. Go into Preferences
4. Add ```https://grumpyoldpizza.github.io/arduino-STM32L4/package_STM32L4_boards_index.json``` as an "Additional Board Manager URL"
5. Open the Boards Manager from the Tools -> Board menu and install "STM32L4 Boards by Tlera Corp"
6. Select your STM32L4 board from the Tools -> Board menu

#### OS Specific Setup

##### Linux

1. Go to ~/.arduino15/packages/grumpyoldpizza/hardware/stm32l4/```<VERSION>```/drivers/linux/
2. sudo cp *.rules /etc/udev/rules.d
3. reboot

##### Windows

###### STM32 BOOTLOADER driver setup for Tlera Corp boards

1. Download [Zadig](http://zadig.akeo.ie)
2. Plugin STM32L4 board and toggle the RESET button while holding down the BOOT button
3. Let Windows finish searching for drivers
4. Start ```Zadig```
5. Select ```Options -> List All Devices```
6. Select ```STM32 BOOTLOADER``` from the device dropdown
7. Select ```WinUSB (v6.1.7600.16385)``` as new driver
8. Click ```Replace Driver```

###### USB Serial driver setup for Tlera Corp boards (Window XP / Windows 7 only)

1. Go to ~/AppData/Local/Arduino15/packages/grumpypoldpizza/hardware/stm32l4/```<VERSION>```/drivers/windows
2. Right-click on ```dpinst_x86.exe``` (32 bit Windows) or ```dpinst_amd64.exe``` (64 bit Windows) and select ```Run as administrator```
3. Click on ```Install this driver software anyway``` at the ```Windows Security``` popup as the driver is unsigned

###### ST-LINK V2.1 driver setup for NUCLEO boards

1. Plugin NUCLEO board
2. Download and install [ST-Link USB Drivers](http://www.st.com/en/embedded-software/stsw-link009.html)

### From git (for core development)

1. Follow steps from Board Manager section above
2. ```cd <SKETCHBOOK>```, where ```<SKETCHBOOK>``` is your Arduino Sketch folder:
* OS X: ```~/Documents/Arduino```
* Linux: ```~/Arduino```
* Windows: ```~/Documents/Arduino```
3. Create a folder named ```hardware```, if it does not exist, and change directories to it
4. Clone this repo: ```git clone https://github.com/grumpyoldpizza/arduino-STM32L4.git grumpyoldpizza/stm32l4```
5. Restart the Arduino IDE

## Recovering from a faulty sketch for Tlera Corp Boards

Sometimes a faulty sketch can render the normal USB Serial based integration into the Arduindo IDE not working. In this case plugin the STM32L4 board and toggle the RESET button while holding down the BOOT button and program a known to be working sketch to go ack to a working USB Serial setup.

## Credits

This core is based on the [Arduino SAMD Core](https://github.com/arduino/ArduinoCore-samd)
<b>NOTE</b>: This is a fork of Thomas Roell's [arduino-STM32L4](https://github.com/GrumpyOldPizza/arduino-STM32L4) repository. This fork is meant for working with the Ladybug Flight Controller board. Unless you are working with that specific board, you should be using the master branch of the repository.

If you do have a Ladybug Flight Controller board, follow the directions on our [wiki](https://github.com/simondlevy/Hackflight/wiki/Hackflight-LadybugFC-Wiki) to install this fork.
5 changes: 5 additions & 0 deletions cores/stm32l4/CDC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ extern int (*stm32l4_stdio_put)(char, FILE*);

static int serialusb_stdio_put(char data, FILE *fp)
{
(void)fp;

return Serial.write(&data, 1);
}

Expand Down Expand Up @@ -77,6 +79,9 @@ void CDC::begin(unsigned long baudrate)

void CDC::begin(unsigned long baudrate, uint16_t config)
{
(void)baudrate;
(void)config;

/* If USBD_CDC has already been enabled/initialized by STDIO, just add the notify.
*/
if (_usbd_cdc->state == USBD_CDC_STATE_INIT) {
Expand Down
1 change: 1 addition & 0 deletions cores/stm32l4/stm32l4_wiring_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ static uint8_t _writeCalibrate = 3;

void analogReference(eAnalogReference reference)
{
(void)reference;
}

void analogReadResolution(int resolution)
Expand Down
3 changes: 3 additions & 0 deletions cores/stm32l4/stm32l4_wiring_tone.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ static stm32l4_timer_t stm32l4_tone;

static void tone_event_callback(void *context, uint32_t events)
{
(void)context;
(void)events;

if (toneCount) {
if (toneGPIO->ODR & toneBit) {
toneGPIO->BRR = toneBit;
Expand Down