Skip to content

Commit 375f6fb

Browse files
authored
Merge pull request #1554 from fpistm/codespell
ci: add codespell action
2 parents a1fde7f + 8c66218 commit 375f6fb

Some content is hidden

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

49 files changed

+179
-118
lines changed

.github/workflows/CodeSpell.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: codespell
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
jobs:
11+
codespell:
12+
name: Check for spelling errors
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
19+
# See: https://github.com/codespell-project/actions-codespell/blob/master/README.md
20+
- name: Spell check
21+
uses: codespell-project/actions-codespell@master
22+
with:
23+
check_filenames: true
24+
check_hidden: true
25+
# In the event of a false positive, add the word in all lower case to this file:
26+
ignore_words_file: ./CI/codespell/.codespellignore
27+
skip: ./.git,./CI,./system/Drivers,./system/Middlewares

CI/codespell/.codespellignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
busses
2+
dout
3+
exten
4+
hart
5+
hsi
6+
noe
7+
nwe
8+

CI/codespell/.codespellrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[codespell]
2+
check-filenames =
3+
check-hidden =
4+
skip = ./.git,./CI,./system/Drivers,./system/Middlewares
5+
ignore-words = ./CI/codespell/.codespellignore

CI/codespell/codespell.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## [codespell]
2+
3+
[codespell] is used to check common misspellings and fix them.
4+
5+
To execute it within this repository, it has to be installed first, see [installation](https://github.com/codespell-project/codespell#installation).
6+
Then run from the root folder this command using the configuration file:
7+
8+
* Linux or equivalent:
9+
10+
```console
11+
codespell --config ./CI/codespell/.codespellrc
12+
```
13+
14+
* Windows
15+
16+
```console
17+
codespell.exe --config .\CI\codespell\.codespellrc
18+
```
19+
20+
21+
[codespell]: https://github.com/codespell-project/codespell

CI/update/stm32cube.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
hal_dest_path = system_dest_path / hal_src_path
4343
cmsis_dest_path = system_dest_path / hal_src_path / "CMSIS" / "Device" / "ST"
4444

45-
stm32_list = [] # Serie
45+
stm32_list = [] # series
4646
cube_versions = collections.OrderedDict() # key: serie name, value: cube version
4747
cube_HAL_versions = collections.OrderedDict() # key: serie name, value: HAL version
4848
cube_CMSIS_versions = collections.OrderedDict() # key: serie name, value: CMSIS version

CI/update/stm32variant.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2012,7 +2012,7 @@ def aggregate_dir():
20122012
# Get all mcu_dir
20132013
mcu_dirs = sorted(mcu_family.glob("*/"))
20142014

2015-
# Group mcu directories when only expressions and xml file name are differents
2015+
# Group mcu directories when only expressions and xml file name are different
20162016
while mcu_dirs:
20172017
# Pop first item
20182018
group_mcu_dir = [mcu_dirs.pop(0)]

CI/utils/pathlib_ext.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def copyFile(src, dest):
3636

3737

3838
def genSTM32List(path, pattern):
39-
stm32_list = [] # Serie
39+
stm32_list = [] # series
4040
dir_pattern = re.compile(r"^STM32(.*)xx_HAL_Driver$", re.IGNORECASE)
4141

4242
if pattern is not None:

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ To report a bug/request please file an issue in the right repository
99
(example for [Arduino_Core_STM32](https://github.com/stm32duino/Arduino_Core_STM32/issues/new/choose)).
1010
But check the following boxes before posting an issue:
1111

12-
- [ ] `Make sure you are using the latest STM32 core and libraries versions.` See [lastest core here](https://github.com/stm32duino/Arduino_Core_STM32/releases/latest).
12+
- [ ] `Make sure you are using the latest STM32 core and libraries versions.` See [latest core here](https://github.com/stm32duino/Arduino_Core_STM32/releases/latest).
1313
- [ ] `Your issue is NOT a question/feedback/suggestions.` This should be discussed on the [stm32duino forum](http://stm32duino.com):
1414
* questions on the [STM32 Core](http://stm32duino.com/viewforum.php?f=35).
1515
* bugs/enhancements on the [STM core: Bugs and enhancements](http://stm32duino.com/viewforum.php?f=38).

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[![forums](https://img.shields.io/badge/join-the%20forums-blue.svg)](https://www.stm32duino.com/)
33
[![wiki](https://img.shields.io/badge/browse-the%20wiki-orange.svg)](https://github.com/stm32duino/wiki/wiki)
44
[![STM32 Core Continuous Integration](https://github.com/stm32duino/Arduino_Core_STM32/workflows/STM32%20Core%20Continuous%20Integration/badge.svg?branch=main)](https://github.com/stm32duino/Arduino_Core_STM32/actions)
5-
5+
[![codespell](https://github.com/stm32duino/Arduino_Core_STM32/workflows/codespell/badge.svg)](https://github.com/stm32duino/Arduino_Core_STM32/actions?workflow=codespell)
66

77

88
[![GitHub release](https://img.shields.io/github/release/stm32duino/Arduino_Core_STM32.svg)](https://github.com/stm32duino/Arduino_Core_STM32/releases/latest)

cores/arduino/HardwareSerial.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ HardwareSerial::HardwareSerial(void *peripheral, HalfDuplexMode_t halfDuplex)
265265
setTx(PIN_SERIALLP2_TX);
266266
} else
267267
#endif
268-
// else get the pins of the first peripheral occurence in PinMap
268+
// else get the pins of the first peripheral occurrence in PinMap
269269
{
270270
_serial.pin_rx = pinmap_pin(peripheral, PinMap_UART_RX);
271271
_serial.pin_tx = pinmap_pin(peripheral, PinMap_UART_TX);
@@ -485,7 +485,7 @@ void HardwareSerial::flush()
485485
// nop, the interrupt handler will free up space for us
486486
}
487487
// If we get here, nothing is queued anymore (DRIE is disabled) and
488-
// the hardware finished tranmission (TXC is set).
488+
// the hardware finished transmission (TXC is set).
489489
}
490490

491491
size_t HardwareSerial::write(const uint8_t *buffer, size_t size)

cores/arduino/HardwareSerial.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
// using a ring buffer (I think), in which head is the index of the location
3434
// to which to write the next incoming character and tail is the index of the
3535
// location from which to read.
36-
// NOTE: a "power of 2" buffer size is reccomended to dramatically
36+
// NOTE: a "power of 2" buffer size is recommended to dramatically
3737
// optimize all the modulo operations for ring buffers.
3838
// WARNING: When buffer sizes are increased to > 256, the buffer index
3939
// variables are automatically increased in size, but the extra

cores/arduino/HardwareTimer.cpp

+16-16
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ HardwareTimer::HardwareTimer()
5050
* @brief HardwareTimer constructor: set default configuration values
5151
* The timer will be usable directly, there is no need to call
5252
* setup(). Using this constructor is not recommended for
53-
* global variables that are automatically initalized at
53+
* global variables that are automatically initialized at
5454
* startup, since this will happen to early to report any
5555
* errors. Better use the argumentless constructor and call the
5656
* setup() method during initialization later.
@@ -195,7 +195,7 @@ void HardwareTimer::pauseChannel(uint32_t channel)
195195
}
196196
#endif
197197

198-
// In case 2 channels are used, disbale also the 2nd one
198+
// In case 2 channels are used, disable also the 2nd one
199199
if (_ChannelMode[channel - 1] == TIMER_INPUT_FREQ_DUTY_MEASUREMENT) {
200200
// Identify and configure 2nd associated channel
201201
timAssociatedInputChannel = getAssociatedChannel(channel);
@@ -470,7 +470,7 @@ void HardwareTimer::setPrescaleFactor(uint32_t prescaler)
470470

471471
/**
472472
* @brief Retrieve overflow (rollover) value from hardware register
473-
* @param format of returned value. If ommited default format is Tick
473+
* @param format of returned value. If omitted default format is Tick
474474
* @retval overflow depending on format value:
475475
* TICK_FORMAT: return number of tick for overflow
476476
* MICROSEC_FORMAT: return number of microsecondes for overflow
@@ -505,7 +505,7 @@ uint32_t HardwareTimer::getOverflow(TimerFormat_t format)
505505
* (usually the next timer overflow). See setPreloadEnable()
506506
* for controlling this behaviour.
507507
* @param overflow: depend on format parameter
508-
* @param format of overflow parameter. If ommited default format is Tick
508+
* @param format of overflow parameter. If omitted default format is Tick
509509
* TICK_FORMAT: overflow is the number of tick for overflow
510510
* MICROSEC_FORMAT: overflow is the number of microsecondes for overflow
511511
* HERTZ_FORMAT: overflow is the frequency in hertz for overflow
@@ -548,8 +548,8 @@ void HardwareTimer::setOverflow(uint32_t overflow, TimerFormat_t format)
548548
}
549549

550550
/**
551-
* @brief Retreive timer counter value
552-
* @param format of returned value. If ommited default format is Tick
551+
* @brief Retrieve timer counter value
552+
* @param format of returned value. If omitted default format is Tick
553553
* @retval overflow depending on format value:
554554
* TICK_FORMAT: return number of tick for counter
555555
* MICROSEC_FORMAT: return number of microsecondes for counter
@@ -578,7 +578,7 @@ uint32_t HardwareTimer::getCount(TimerFormat_t format)
578578
/**
579579
* @brief Set timer counter value
580580
* @param counter: depend on format parameter
581-
* @param format of overflow parameter. If ommited default format is Tick
581+
* @param format of overflow parameter. If omitted default format is Tick
582582
* TICK_FORMAT: counter is the number of tick
583583
* MICROSEC_FORMAT: counter is the number of microsecondes
584584
* HERTZ_FORMAT: counter is the frequency in hertz
@@ -793,7 +793,7 @@ void HardwareTimer::setPreloadEnable(bool value)
793793
* @brief Set channel Capture/Compare register
794794
* @param channel: Arduino channel [1..4]
795795
* @param compare: compare value depending on format
796-
* @param format of compare parameter. If ommited default format is Tick
796+
* @param format of compare parameter. If omitted default format is Tick
797797
* TICK_FORMAT: compare is the number of tick
798798
* MICROSEC_FORMAT: compare is the number of microsecondes
799799
* HERTZ_FORMAT: compare is the frequency in hertz
@@ -857,7 +857,7 @@ void HardwareTimer::setCaptureCompare(uint32_t channel, uint32_t compare, TimerC
857857
/**
858858
* @brief Retrieve Capture/Compare value
859859
* @param channel: Arduino channel [1..4]
860-
* @param format of return value. If ommited default format is Tick
860+
* @param format of return value. If omitted default format is Tick
861861
* TICK_FORMAT: return value is the number of tick for Capture/Compare value
862862
* MICROSEC_FORMAT: return value is the number of microsecondes for Capture/Compare value
863863
* HERTZ_FORMAT: return value is the frequency in hertz for Capture/Compare value
@@ -913,7 +913,7 @@ uint32_t HardwareTimer::getCaptureCompare(uint32_t channel, TimerCompareFormat_
913913
/**
914914
* @param channel: Arduino channel [1..4]
915915
* @param pin: Arduino pin number, ex D1, 1 or PA1
916-
* @param frequency: PWM frequency expessed in hertz
916+
* @param frequency: PWM frequency expressed in hertz
917917
* @param dutycycle: PWM dutycycle expressed in percentage
918918
* @param PeriodCallback: timer period callback (timer rollover upon udate event)
919919
* @param CompareCallback: timer compare callback
@@ -928,7 +928,7 @@ void HardwareTimer::setPWM(uint32_t channel, uint32_t pin, uint32_t frequency, u
928928
* @brief All in one function to configure PWM
929929
* @param channel: Arduino channel [1..4]
930930
* @param pin: pin name, ex PB_0
931-
* @param frequency: PWM frequency expessed in hertz
931+
* @param frequency: PWM frequency expressed in hertz
932932
* @param dutycycle: PWM dutycycle expressed in percentage
933933
* @param PeriodCallback: timer period callback (timer rollover upon udate event)
934934
* @param CompareCallback: timer compare callback
@@ -992,7 +992,7 @@ void HardwareTimer::attachInterrupt(callback_function_t callback)
992992
}
993993

994994
/**
995-
* @brief Dettach interrupt callback on update (rollover) event
995+
* @brief Detach interrupt callback on update (rollover) event
996996
* @retval None
997997
*/
998998
void HardwareTimer::detachInterrupt()
@@ -1033,7 +1033,7 @@ void HardwareTimer::attachInterrupt(uint32_t channel, callback_function_t callba
10331033
}
10341034

10351035
/**
1036-
* @brief Dettach interrupt callback on Capture/Compare event
1036+
* @brief Detach interrupt callback on Capture/Compare event
10371037
* @param channel: Arduino channel [1..4]
10381038
* @retval None
10391039
*/
@@ -1078,7 +1078,7 @@ bool HardwareTimer::hasInterrupt(uint32_t channel)
10781078
/**
10791079
* @brief Generate an update event to force all registers (Autoreload, prescaler, compare) to be taken into account
10801080
* @note Refresh() can only be called after a 1st call to resume() to be sure timer is initialised.
1081-
* It is usefull while timer is running after some registers update
1081+
* It is useful while timer is running after some registers update
10821082
* @retval None
10831083
*/
10841084
void HardwareTimer::refresh()
@@ -1118,7 +1118,7 @@ void HardwareTimer::updateCallback(TIM_HandleTypeDef *htim)
11181118
}
11191119

11201120
/**
1121-
* @brief Generic Caputre and Compare callback which will call user callback
1121+
* @brief Generic Capture and Compare callback which will call user callback
11221122
* @param htim: HAL timer handle
11231123
* @retval None
11241124
*/
@@ -1187,7 +1187,7 @@ bool HardwareTimer::isRunningChannel(uint32_t channel)
11871187
Error_Handler();
11881188
}
11891189

1190-
// channel is runnning if: timer is running, and either output channel is
1190+
// channel is running if: timer is running, and either output channel is
11911191
// enabled or interrupt is set
11921192
ret = LL_TIM_CC_IsEnabledChannel(_timerObj.handle.Instance, LLChannel)
11931193
|| (__HAL_TIM_GET_IT_SOURCE(&(_timerObj.handle), interrupt) == SET);

cores/arduino/HardwareTimer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class HardwareTimer {
115115
void setOverflow(uint32_t val, TimerFormat_t format = TICK_FORMAT); // set AutoReload register depending on format provided
116116
uint32_t getOverflow(TimerFormat_t format = TICK_FORMAT); // return overflow depending on format provided
117117

118-
void setPWM(uint32_t channel, PinName pin, uint32_t frequency, uint32_t dutycycle, callback_function_t PeriodCallback = nullptr, callback_function_t CompareCallback = nullptr); // Set all in one command freq in HZ, Duty in percentage. Including both interrup.
118+
void setPWM(uint32_t channel, PinName pin, uint32_t frequency, uint32_t dutycycle, callback_function_t PeriodCallback = nullptr, callback_function_t CompareCallback = nullptr); // Set all in one command freq in HZ, Duty in percentage. Including both interrupt.
119119
void setPWM(uint32_t channel, uint32_t pin, uint32_t frequency, uint32_t dutycycle, callback_function_t PeriodCallback = nullptr, callback_function_t CompareCallback = nullptr);
120120

121121
void setCount(uint32_t val, TimerFormat_t format = TICK_FORMAT); // set timer counter to value 'val' depending on format provided
@@ -143,7 +143,7 @@ class HardwareTimer {
143143
bool hasInterrupt(uint32_t channel); //returns true if an interrupt has already been set on the channel compare match
144144
void timerHandleDeinit(); // Timer deinitialization
145145

146-
// Refresh() is usefull while timer is running after some registers update
146+
// Refresh() is useful while timer is running after some registers update
147147
void refresh(void); // Generate update event to force all registers (Autoreload, prescaler, compare) to be taken into account
148148

149149
uint32_t getTimerClkFreq(); // return timer clock frequency in Hz.

cores/arduino/Print.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class Print {
6969
}
7070

7171
// default to zero, meaning "a single write may block"
72-
// should be overriden by subclasses with buffering
72+
// should be overridden by subclasses with buffering
7373
virtual int availableForWrite()
7474
{
7575
return 0;

cores/arduino/Stream.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <inttypes.h>
2626
#include "Print.h"
2727

28-
// compatability macros for testing
28+
// compatibility macros for testing
2929
/*
3030
#define getInt() parseInt()
3131
#define getInt(ignore) parseInt(ignore)

cores/arduino/WString.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class String {
9797

9898
// returns true on success, false on failure (in which case, the string
9999
// is left unchanged). if the argument is null or invalid, the
100-
// concatenation is considered unsucessful.
100+
// concatenation is considered unsuccessful.
101101
unsigned char concat(const String &str);
102102
unsigned char concat(const char *cstr);
103103
unsigned char concat(char c);
@@ -213,7 +213,7 @@ class String {
213213
unsigned char startsWith(const String &prefix, unsigned int offset) const;
214214
unsigned char endsWith(const String &suffix) const;
215215

216-
// character acccess
216+
// character access
217217
char charAt(unsigned int index) const;
218218
void setCharAt(unsigned int index, char c);
219219
char operator [](unsigned int index) const;

cores/arduino/pins_arduino.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ PinName analogInputToPinName(uint32_t pin);
169169
#define digitalPinIsValid(p) (digitalPinToPinName(p) != NC)
170170

171171
/* As some pin could be duplicated in digitalPin[] */
172-
/* return first occurence of linked PinName (PYx) */
172+
/* return first occurrence of linked PinName (PYx) */
173173
#define digitalPinFirstOccurence(p) (pinNametoDigitalPin(digitalPinToPinName(p)))
174174

175175
/* Specific for Firmata */

cores/arduino/stm32/OpenAMP/rsc_table.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
******************************************************************************
33
* @file rsc_table.c
44
* @author MCD Application Team
5-
* @brief Ressource table
5+
* @brief Resource table
66
*
77
* This file provides a default resource table requested by remote proc to
88
* load the elf file. It also allows to add debug trace using a shared buffer.

cores/arduino/stm32/OpenAMP/virtio_buffer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static uint16_t read(virtio_buffer_t *ring, uint8_t *dst, uint16_t size, bool pe
5858
// Manage ring buffer rollover
5959
// First, copy ring buffer from read index to end of buffer
6060
memcpy(dst, ring->buffer + read_index, VIRTIO_BUFFER_SIZE - read_index);
61-
// then, copy ring buffer from begining of buffer to end of read
61+
// then, copy ring buffer from beginning of buffer to end of read
6262
memcpy(dst + VIRTIO_BUFFER_SIZE - read_index, ring->buffer, size - (VIRTIO_BUFFER_SIZE - read_index));
6363
} else {
6464
memcpy(dst, ring->buffer + read_index, size);

cores/arduino/stm32/PeripheralPins.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ extern const PinMap PinMap_I2C_SDA[];
4747
extern const PinMap PinMap_I2C_SCL[];
4848

4949
//*** TIM ***
50-
/* For backward compatibilty */
50+
/* For backward compatibility */
5151
#define PinMap_PWM PinMap_TIM
5252
extern const PinMap PinMap_TIM[];
5353

cores/arduino/stm32/usb/cdc/usbd_cdc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ __ALIGN_BEGIN static uint8_t USBD_CDC_CfgFSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN
347347
};
348348

349349
__ALIGN_BEGIN static uint8_t USBD_CDC_OtherSpeedCfgDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END = {
350-
0x09, /* bLength: Configuation Descriptor size */
350+
0x09, /* bLength: Configuration Descriptor size */
351351
USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION,
352352
USB_CDC_CONFIG_DESC_SIZ,
353353
0x00,

cores/arduino/stm32/usb/hid/usbd_hid_composite.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ static uint8_t USBD_HID_DeInit(USBD_HandleTypeDef *pdev,
581581
static uint8_t USBD_COMPOSITE_HID_Setup(USBD_HandleTypeDef *pdev,
582582
USBD_SetupReqTypedef *req)
583583
{
584-
/* Check which interface is targetted by this request */
584+
/* Check which interface is targeted by this request */
585585
if ((req->wIndex & 0x00FF) == HID_KEYBOARD_INTERFACE) {
586586
return USBD_HID_KEYBOARD_Setup(pdev, req);
587587
} else {

cores/arduino/stm32/usb/hid/usbd_hid_composite_if.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void HID_Composite_DeInit(HID_Interface device)
8787
/**
8888
* @brief Send HID mouse Report
8989
* @param report pointer to report
90-
* @param len report lenght
90+
* @param len report length
9191
* @retval none
9292
*/
9393
void HID_Composite_mouse_sendReport(uint8_t *report, uint16_t len)
@@ -98,7 +98,7 @@ void HID_Composite_mouse_sendReport(uint8_t *report, uint16_t len)
9898
/**
9999
* @brief Send HID keyboard Report
100100
* @param report pointer to report
101-
* @param len report lenght
101+
* @param len report length
102102
* @retval none
103103
*/
104104
void HID_Composite_keyboard_sendReport(uint8_t *report, uint16_t len)

0 commit comments

Comments
 (0)