Skip to content

Commit b9bdcf2

Browse files
authored
Merge pull request #49 from fpistm/ci
CI deployement
2 parents 8dc2821 + cd596f3 commit b9bdcf2

File tree

10 files changed

+167
-80
lines changed

10 files changed

+167
-80
lines changed

.github/workflows/astyle.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: astyle
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths-ignore:
7+
- '*.json'
8+
- '**.md'
9+
- keywords.txt
10+
- library.properties
11+
pull_request:
12+
paths-ignore:
13+
- '*.json'
14+
- '**.md'
15+
- keywords.txt
16+
- library.properties
17+
workflow_dispatch:
18+
jobs:
19+
astyle:
20+
name: Check code formatting
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@main
24+
- uses: stm32duino/actions/astyle-check@main
25+
# Use the output from the `Astyle` step
26+
- name: Astyle Errors
27+
if: failure()
28+
run: |
29+
cat ${{ steps.Astyle.outputs.astyle-result }}
30+
exit 1

.github/workflows/codespell.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: codespell
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
workflow_dispatch:
8+
jobs:
9+
codespell:
10+
name: Check for spelling errors
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@main
14+
- uses: codespell-project/actions-codespell@master
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Compile Examples
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths-ignore:
7+
- '*.json'
8+
- '**.md'
9+
- keywords.txt
10+
- library.properties
11+
pull_request:
12+
workflow_dispatch:
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
matrix:
20+
fqbn:
21+
- STMicroelectronics:stm32:GenF1:pnum=BLUEBUTTON_F103RCT
22+
- STMicroelectronics:stm32:Nucleo_144:pnum=NUCLEO_F207ZG
23+
- STMicroelectronics:stm32:GenF4:pnum=FEATHER_F405
24+
- STMicroelectronics:stm32:Disco:pnum=DISCO_F746NG
25+
- STMicroelectronics:stm32:GenH7:pnum=DAISY_PATCH_SM
26+
- STMicroelectronics:stm32:Eval:pnum=STEVAL_MKSBOX1V1,usb=CDCgen
27+
- STMicroelectronics:stm32:Nucleo_144:pnum=NUCLEO_L552ZE_Q
28+
- STMicroelectronics:stm32:Nucleo_144:pnum=NUCLEO_U575ZI_Q
29+
steps:
30+
- uses: actions/checkout@main
31+
- uses: arduino/compile-sketches@v1
32+
with:
33+
fqbn: ${{ matrix.fqbn }}
34+
platforms: |
35+
- source-url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
36+
name: STMicroelectronics:stm32
37+
libraries: |
38+
# Install the library from the local path.
39+
- source-path: ./
40+
- name: FatFS

src/SD.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
directories which simplifies interacting with files in subdirectories.
2727
2828
* Utility methods are provided to determine whether a file exists
29-
and to create a directory heirarchy.
29+
and to create a directory hierarchy.
3030
3131
*/
3232

@@ -144,13 +144,13 @@ File SDClass::open(const char *filepath, uint8_t mode /* = FA_READ */)
144144
file._fil->fs = 0;
145145
file._dir.fs = 0;
146146
#endif
147-
147+
148148
if ((mode == FILE_WRITE) && (!SD.exists(filepath))) {
149149
mode = mode | FA_CREATE_ALWAYS;
150150
}
151151

152152
file._res = f_open(file._fil, filepath, mode);
153-
if ( file._res != FR_OK) {
153+
if (file._res != FR_OK) {
154154
free(file._fil);
155155
file._fil = NULL;
156156
file._res = f_opendir(&file._dir, filepath);

src/STM32SD.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ class File {
7474
DIR _dir = {}; // init all fields to 0
7575
FRESULT _res = FR_OK;
7676

77-
FRESULT getErrorstate(void) {return _res;}
77+
FRESULT getErrorstate(void)
78+
{
79+
return _res;
80+
}
7881

7982
};
8083

src/bsp_sd.c

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -41,82 +41,82 @@
4141

4242
/* Definition for BSP SD */
4343
#if defined(SDMMC1) || defined(SDMMC2)
44-
#ifndef SD_INSTANCE
45-
#define SD_INSTANCE SDMMC1
46-
#endif
47-
48-
#define SD_CLK_ENABLE __HAL_RCC_SDMMC1_CLK_ENABLE
49-
#define SD_CLK_DISABLE __HAL_RCC_SDMMC1_CLK_DISABLE
50-
#ifdef SDMMC2
51-
#define SD_CLK2_ENABLE __HAL_RCC_SDMMC2_CLK_ENABLE
52-
#define SD_CLK2_DISABLE __HAL_RCC_SDMMC2_CLK_DISABLE
53-
#endif
54-
55-
#define SD_CLK_EDGE SDMMC_CLOCK_EDGE_RISING
56-
#define SD_CLK_BYPASS SDMMC_CLOCK_BYPASS_DISABLE
57-
#define SD_CLK_PWR_SAVE SDMMC_CLOCK_POWER_SAVE_DISABLE
58-
#define SD_BUS_WIDE_1B SDMMC_BUS_WIDE_1B
59-
#define SD_BUS_WIDE_4B SDMMC_BUS_WIDE_4B
60-
#define SD_BUS_WIDE_8B SDMMC_BUS_WIDE_8B
61-
#define SD_HW_FLOW_CTRL_ENABLE SDMMC_HARDWARE_FLOW_CONTROL_ENABLE
62-
#define SD_HW_FLOW_CTRL_DISABLE SDMMC_HARDWARE_FLOW_CONTROL_DISABLE
63-
64-
#ifdef STM32H7xx
65-
#define SD_CLK_DIV 1
66-
#else
67-
#define SD_CLK_DIV SDMMC_TRANSFER_CLK_DIV
68-
#endif
69-
70-
#ifdef SDMMC_TRANSCEIVER_ENABLE
71-
#define SD_TRANSCEIVER_ENABLE SDMMC_TRANSCEIVER_ENABLE
72-
#define SD_TRANSCEIVER_DISABLE SDMMC_TRANSCEIVER_DISABLE
73-
#endif
44+
#ifndef SD_INSTANCE
45+
#define SD_INSTANCE SDMMC1
46+
#endif
47+
48+
#define SD_CLK_ENABLE __HAL_RCC_SDMMC1_CLK_ENABLE
49+
#define SD_CLK_DISABLE __HAL_RCC_SDMMC1_CLK_DISABLE
50+
#ifdef SDMMC2
51+
#define SD_CLK2_ENABLE __HAL_RCC_SDMMC2_CLK_ENABLE
52+
#define SD_CLK2_DISABLE __HAL_RCC_SDMMC2_CLK_DISABLE
53+
#endif
54+
55+
#define SD_CLK_EDGE SDMMC_CLOCK_EDGE_RISING
56+
#define SD_CLK_BYPASS SDMMC_CLOCK_BYPASS_DISABLE
57+
#define SD_CLK_PWR_SAVE SDMMC_CLOCK_POWER_SAVE_DISABLE
58+
#define SD_BUS_WIDE_1B SDMMC_BUS_WIDE_1B
59+
#define SD_BUS_WIDE_4B SDMMC_BUS_WIDE_4B
60+
#define SD_BUS_WIDE_8B SDMMC_BUS_WIDE_8B
61+
#define SD_HW_FLOW_CTRL_ENABLE SDMMC_HARDWARE_FLOW_CONTROL_ENABLE
62+
#define SD_HW_FLOW_CTRL_DISABLE SDMMC_HARDWARE_FLOW_CONTROL_DISABLE
63+
64+
#ifdef STM32H7xx
65+
#define SD_CLK_DIV 1
66+
#else
67+
#define SD_CLK_DIV SDMMC_TRANSFER_CLK_DIV
68+
#endif
69+
70+
#ifdef SDMMC_TRANSCEIVER_ENABLE
71+
#define SD_TRANSCEIVER_ENABLE SDMMC_TRANSCEIVER_ENABLE
72+
#define SD_TRANSCEIVER_DISABLE SDMMC_TRANSCEIVER_DISABLE
73+
#endif
7474

7575
#elif defined(SDIO)
76-
#define SD_INSTANCE SDIO
77-
#define SD_CLK_ENABLE __HAL_RCC_SDIO_CLK_ENABLE
78-
#define SD_CLK_DISABLE __HAL_RCC_SDIO_CLK_DISABLE
79-
#define SD_CLK_EDGE SDIO_CLOCK_EDGE_RISING
80-
#define SD_CLK_BYPASS SDIO_CLOCK_BYPASS_DISABLE
81-
#define SD_CLK_PWR_SAVE SDIO_CLOCK_POWER_SAVE_DISABLE
82-
#define SD_BUS_WIDE_1B SDIO_BUS_WIDE_1B
83-
#define SD_BUS_WIDE_4B SDIO_BUS_WIDE_4B
84-
#define SD_BUS_WIDE_8B SDIO_BUS_WIDE_8B
85-
#define SD_HW_FLOW_CTRL_ENABLE SDIO_HARDWARE_FLOW_CONTROL_ENABLE
86-
#define SD_HW_FLOW_CTRL_DISABLE SDIO_HARDWARE_FLOW_CONTROL_DISABLE
87-
#define SD_CLK_DIV SDIO_TRANSFER_CLK_DIV
76+
#define SD_INSTANCE SDIO
77+
#define SD_CLK_ENABLE __HAL_RCC_SDIO_CLK_ENABLE
78+
#define SD_CLK_DISABLE __HAL_RCC_SDIO_CLK_DISABLE
79+
#define SD_CLK_EDGE SDIO_CLOCK_EDGE_RISING
80+
#define SD_CLK_BYPASS SDIO_CLOCK_BYPASS_DISABLE
81+
#define SD_CLK_PWR_SAVE SDIO_CLOCK_POWER_SAVE_DISABLE
82+
#define SD_BUS_WIDE_1B SDIO_BUS_WIDE_1B
83+
#define SD_BUS_WIDE_4B SDIO_BUS_WIDE_4B
84+
#define SD_BUS_WIDE_8B SDIO_BUS_WIDE_8B
85+
#define SD_HW_FLOW_CTRL_ENABLE SDIO_HARDWARE_FLOW_CONTROL_ENABLE
86+
#define SD_HW_FLOW_CTRL_DISABLE SDIO_HARDWARE_FLOW_CONTROL_DISABLE
87+
#define SD_CLK_DIV SDIO_TRANSFER_CLK_DIV
8888
#else
89-
#error "Unknown SD_INSTANCE"
89+
#error "Unknown SD_INSTANCE"
9090
#endif
9191

9292
#ifndef SD_HW_FLOW_CTRL
93-
#define SD_HW_FLOW_CTRL SD_HW_FLOW_CTRL_DISABLE
93+
#define SD_HW_FLOW_CTRL SD_HW_FLOW_CTRL_DISABLE
9494
#endif
9595

9696
#ifndef SD_BUS_WIDE
97-
#define SD_BUS_WIDE SD_BUS_WIDE_4B
97+
#define SD_BUS_WIDE SD_BUS_WIDE_4B
9898
#endif
9999

100100
#if defined(SDMMC_TRANSCEIVER_ENABLE) && !defined(SD_TRANSCEIVER_MODE)
101-
#define SD_TRANSCEIVER_MODE SD_TRANSCEIVER_DISABLE
101+
#define SD_TRANSCEIVER_MODE SD_TRANSCEIVER_DISABLE
102102
#endif
103103

104104
/* BSP SD Private Variables */
105105
static SD_HandleTypeDef uSdHandle;
106106
static uint32_t SD_detect_ll_gpio_pin = LL_GPIO_PIN_ALL;
107107
static GPIO_TypeDef *SD_detect_gpio_port = GPIOA;
108108
#ifdef SDMMC_TRANSCEIVER_ENABLE
109-
static uint32_t SD_trans_en_ll_gpio_pin = LL_GPIO_PIN_ALL;
110-
static GPIO_TypeDef *SD_trans_en_gpio_port = GPIOA;
111-
static uint32_t SD_trans_sel_ll_gpio_pin = LL_GPIO_PIN_ALL;
112-
static GPIO_TypeDef *SD_trans_sel_gpio_port = GPIOA;
109+
static uint32_t SD_trans_en_ll_gpio_pin = LL_GPIO_PIN_ALL;
110+
static GPIO_TypeDef *SD_trans_en_gpio_port = GPIOA;
111+
static uint32_t SD_trans_sel_ll_gpio_pin = LL_GPIO_PIN_ALL;
112+
static GPIO_TypeDef *SD_trans_sel_gpio_port = GPIOA;
113113
#endif
114114
#ifndef STM32L1xx
115-
#define SD_OK HAL_OK
116-
#define SD_TRANSFER_OK ((uint8_t)0x00)
117-
#define SD_TRANSFER_BUSY ((uint8_t)0x01)
115+
#define SD_OK HAL_OK
116+
#define SD_TRANSFER_OK ((uint8_t)0x00)
117+
#define SD_TRANSFER_BUSY ((uint8_t)0x01)
118118
#else /* STM32L1xx */
119-
static SD_CardInfo uSdCardInfo;
119+
static SD_CardInfo uSdCardInfo;
120120
#endif
121121

122122

src/bsp_sd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ extern "C" {
5050
#endif
5151
#if !defined(STM32_CORE_VERSION) || (STM32_CORE_VERSION <= 0x01060100)
5252
#error "This library version required a STM32 core version > 1.6.1.\
53-
Please update the core or install previous libray version."
53+
Please update the core or install previous library version."
5454
#endif
5555

5656
/*SD Card information structure */

src/ffconf.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
/* FatFs specific configuration options. */
1212
#if __has_include("ffconf_custom.h")
13-
#include "ffconf_custom.h"
13+
#include "ffconf_custom.h"
1414
#else
15-
#if _FATFS == 68300
16-
#include "ffconf_default_68300.h"
17-
#else
18-
#include "ffconf_default_32020.h"
19-
#endif
15+
#if _FATFS == 68300
16+
#include "ffconf_default_68300.h"
17+
#else
18+
#include "ffconf_default_32020.h"
19+
#endif
2020
#endif
2121
#endif /* _ARDUINO_FFCONF_H */

src/ffconf_default_32020.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
/ option to 1 and f_getfree() function at first time after volume mount will
180180
/ force a full FAT scan.
181181
/
182-
/ 0: Load all informations in the FSINFO if available.
182+
/ 0: Load all information in the FSINFO if available.
183183
/ 1: Do not trust free cluster count in the FSINFO.
184184
*/
185185

@@ -236,7 +236,7 @@
236236
/� These options have no effect at read-only configuration (_FS_READONLY == 1). */
237237

238238
#if _NORTC_YEAR < 1980 || _NORTC_YEAR > 2107 || _NORTC_MON < 1 || _NORTC_MON > 12 || _NORTC_MDAY < 1 || _NORTC_MDAY > 31
239-
#error Invalid _FS_NORTC settings
239+
#error Invalid _FS_NORTC settings
240240
#endif
241241

242242
#endif /* _FFCONFIG */

src/ffconf_default_68300.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210
/ number and only an FAT volume found on the physical drive will be mounted.
211211
/ When multi-partition is enabled (1), each logical drive number can be bound to
212212
/ arbitrary physical drive and partition listed in the VolToPart[]. Also f_fdisk()
213-
/ funciton will be available. */
213+
/ function will be available. */
214214

215215

216216
#define _MIN_SS 512
@@ -287,9 +287,9 @@
287287
#define _FS_REENTRANT 0
288288

289289
#if _FS_REENTRANT
290-
#include "cmsis_os.h"
291-
#define _FS_TIMEOUT 1000
292-
#define _SYNC_t osSemaphoreId
290+
#include "cmsis_os.h"
291+
#define _FS_TIMEOUT 1000
292+
#define _SYNC_t osSemaphoreId
293293
#endif
294294
/* The option _FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs
295295
/ module itself. Note that regardless of this option, file access to different
@@ -311,16 +311,16 @@
311311
/* #include <windows.h> // O/S definitions */
312312

313313
#if _USE_LFN == 3
314-
#if !defined(ff_malloc) || !defined(ff_free)
315-
#include <stdlib.h>
316-
#endif
314+
#if !defined(ff_malloc) || !defined(ff_free)
315+
#include <stdlib.h>
316+
#endif
317317

318-
#if !defined(ff_malloc)
319-
#define ff_malloc malloc
320-
#endif
318+
#if !defined(ff_malloc)
319+
#define ff_malloc malloc
320+
#endif
321321

322-
#if !defined(ff_free)
323-
#define ff_free free
324-
#endif
322+
#if !defined(ff_free)
323+
#define ff_free free
324+
#endif
325325
#endif
326326
/*--- End of configuration options ---*/

0 commit comments

Comments
 (0)