Skip to content

Commit

Permalink
Add spell_check.yml
Browse files Browse the repository at this point in the history
- Enable "Check word spell"
- Actions run every 'push' and 'pull_request'
  • Loading branch information
M-ichae-l committed Feb 13, 2024
1 parent c46f3e9 commit 84a9d07
Show file tree
Hide file tree
Showing 83 changed files with 165 additions and 136 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/spell_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow runs spell_check test for Ameba Arduino SDK

name: Check word spell
on: [push, pull_request]
# workflow_dispatch:
jobs:
spell-check:
name: Run spell-check check
runs-on: ubuntu-latest
strategy:
matrix:
path:
- 'Arduino_package/hardware/cores'
- 'Arduino_package/hardware/libraries'
steps:
- name: Checkout repository # and submodules
uses: actions/checkout@v4
# with:
# submodules: recursive
- name: Run spell-check for multi-floders
# uses: codespell-project/actions-codespell@master
uses: codespell-project/actions-codespell@v2
with:
skip: Arduino_package/hardware/libraries/SoftwareSerial/src/Adafruit_GPS.cpp,Arduino_package/hardware/libraries/SoftwareSerial/src/Adafruit_GPS.h,Arduino_package/hardware/libraries/SoftwareSerial/src/SoftwareSerial.cpp,Arduino_package/hardware/libraries/SoftwareSerial/src/SoftwareSerial.h
# Google_Cloud_IoT.ino - bellow
# DHT.cpp - celcius
ignore_words_list: ameba,bellow,celcius
# ignore_words_file: Ameba_misc/Spell_Check_Ignore/.codespellignore
path: ${{ matrix.path }}
4 changes: 2 additions & 2 deletions Arduino_package/hardware/cores/ambd/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#endif // Arduino_STD_PRINTF

#ifdef __cplusplus
#include <stdio.h> // include before callig min/max in wiring_constants.h
#include <stdio.h> // include before calling min/max in wiring_constants.h
extern "C" {
#endif // __cplusplus

Expand Down Expand Up @@ -121,7 +121,7 @@ typedef struct _PinDescription
uint32_t ulPinMode;
} PinDescription;

/* Pins table to be instanciated into variant.cpp */
/* Pins table to be instantiated into variant.cpp */
extern PinDescription g_APinDescription[];

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion Arduino_package/hardware/cores/ambd/Stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ long Stream::parseInt(char skipChar) {

do {
if (c == skipChar) {
; // ignore this charactor
; // ignore this character
} else if(c == '-') {
isNegative = true;
} else if(c >= '0' && c <= '9') { // is c a digit?
Expand Down
2 changes: 1 addition & 1 deletion Arduino_package/hardware/cores/ambd/Stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <inttypes.h>
#include "Print.h"

// compatability macros for testing
// compatibility macros for testing
/*
#define getInt() parseInt()
#define getInt(skipChar) parseInt(skipchar)
Expand Down
4 changes: 2 additions & 2 deletions Arduino_package/hardware/cores/ambd/WString.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class String {

// returns true on success, false on failure (in which case, the string
// is left unchanged). if the argument is null or invalid, the
// concatenation is considered unsucessful.
// concatenation is considered unsuccessful.
unsigned char concat(const String &str);
unsigned char concat(const char *cstr);
unsigned char concat(char c);
Expand Down Expand Up @@ -154,7 +154,7 @@ class String {
unsigned char startsWith(const String &prefix, unsigned int offset) const;
unsigned char endsWith(const String &suffix) const;

// character acccess
// character access
char charAt(unsigned int index) const;
void setCharAt(unsigned int index, char c);
char operator [] (unsigned int index) const;
Expand Down
2 changes: 1 addition & 1 deletion Arduino_package/hardware/cores/ambd/ard_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ int ota_bind_socket(int server_socket, int OTAport) {
printf("\n[Error] Can not create socket\n");
return -1;
}
// initilize structure dest
// initialize structure dest
memset(&server_addr, 0, sizeof(server_addr));
server_addr.sin_family = AF_INET;
server_addr.sin_port = htons(OTAport);
Expand Down
2 changes: 1 addition & 1 deletion Arduino_package/hardware/cores/ambd/ard_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <mbedtls/debug.h>
#include "ard_ssl.h"

#define ARDUINO_MBEDTLS_DEBUG_LEVEL 0 // Set to 0 to disable debug messsages, 5 to enable all debug messages
#define ARDUINO_MBEDTLS_DEBUG_LEVEL 0 // Set to 0 to disable debug messages, 5 to enable all debug messages

static unsigned int ard_ssl_arc4random(void) {
unsigned int res = xTaskGetTickCount();
Expand Down
2 changes: 1 addition & 1 deletion Arduino_package/hardware/cores/ambd/font5x7.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* where 1 is font color, and 0 is background color
*
* So it's 'A' if we look it in counter-clockwise for 90 degree.
* In general case, we also add a background line to seperate from other character:
* In general case, we also add a background line to separate from other character:
* 0x7C: 01111100
* 0x12: 00010010
* 0x11: 00010001
Expand Down
4 changes: 2 additions & 2 deletions Arduino_package/hardware/cores/ambd/wifi_drv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern "C" {
#include "wifi_structures.h"
#include "lwip_netconf.h"
#include "lwip/err.h"
// modifed here
// modified here
#include "lwip/netif.h"
#include "lwip/api.h"
#include <dhcp/dhcps.h>
Expand Down Expand Up @@ -244,7 +244,7 @@ int8_t WiFiDrv::wifiSetKey(char* ssid, uint8_t ssid_len, uint8_t key_idx, const

#if 0
const unsigned char* k = (const unsigned char *)key;
// convert hex sring to hex value
// convert hex string to hex value
for (int i = 0,int idx = 0; i < len; i++) {
if ((k[i] >= '0') && (k[i] <= '9')) {
password[idx] += (k[i] - '0');
Expand Down
10 changes: 5 additions & 5 deletions Arduino_package/hardware/cores/ambd/wifi_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class WiFiDrv {
* The ssid of the desired network should be specified.
*
* param ssid: The ssid of the desired network.
* param ssid_len: Lenght of ssid string.
* param ssid_len: Length of ssid string.
* return: WL_SUCCESS or WL_FAILURE
*/
static int8_t wifiSetNetwork(char* ssid, uint8_t ssid_len);
Expand All @@ -89,10 +89,10 @@ class WiFiDrv {
* the most secure supported mode will be automatically selected
*
* param ssid: Pointer to the SSID string.
* param ssid_len: Lenght of ssid string.
* param ssid_len: Length of ssid string.
* param passphrase: Passphrase. Valid characters in a passphrase
* must be between ASCII 32-126 (decimal).
* param len: Lenght of passphrase string.
* param len: Length of passphrase string.
* return: WL_SUCCESS or WL_FAILURE
*/
static int8_t wifiSetPassphrase(char* ssid, uint8_t ssid_len, const char *passphrase, const uint8_t len);
Expand All @@ -102,10 +102,10 @@ class WiFiDrv {
* is determined by the size of the key (5 bytes for WEP-40, 13 bytes for WEP-104).
*
* param ssid: Pointer to the SSID string.
* param ssid_len: Lenght of ssid string.
* param ssid_len: Length of ssid string.
* param key_idx: The key index to set. Valid values are 0-3.
* param key: Key input buffer.
* param len: Lenght of key string.
* param len: Length of key string.
* return: WL_SUCCESS or WL_FAILURE
*/
static int8_t wifiSetKey(char* ssid, uint8_t ssid_len, uint8_t key_idx, const void *key, const uint8_t len);
Expand Down
2 changes: 1 addition & 1 deletion Arduino_package/hardware/cores/ambd/wiring.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ extern uint32_t millis(void);
extern uint32_t micros(void);

/**
* \brief Pauses the program for the amount of time (in miliseconds) specified as parameter.
* \brief Pauses the program for the amount of time (in milliseconds) specified as parameter.
* (There are 1000 milliseconds in a second.)
*
* \param dwMs the number of milliseconds to pause (uint32_t)
Expand Down
4 changes: 2 additions & 2 deletions Arduino_package/hardware/cores/ambd/wiring_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* @defgroup wiring_os wiring_os
* OS realted function for thread, signal, software timer, semaphore
* OS related function for thread, signal, software timer, semaphore
* @{
*/

Expand Down Expand Up @@ -142,7 +142,7 @@ extern uint32_t os_thread_terminate_arduino(uint32_t thread_id);
* @brief Pass control to next thread that is in state \b READY.
*
* By default the minimal execution unit is 1 millisecond. In a scenario that if a thread with smaller want to handout execution right to a thread with
* higher priority immediately without waiting for the ending of current 1 millisecond, then invoke os_thread_yield_arduino can transfer exection right to
* higher priority immediately without waiting for the ending of current 1 millisecond, then invoke os_thread_yield_arduino can transfer execution right to
* OS's idle task and check which is the next execution thread.
*
* @return os_status code
Expand Down
2 changes: 1 addition & 1 deletion Arduino_package/hardware/cores/ambd/wiring_watchdog.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extern void wdt_reset(void);
* @ingroup watchdog
* @brief Enable watchdog
*
* After enbling watchdog, user defined code needs to reset it before watchdog barks. Otherwise it would make system reboot.
* After enabling watchdog, user defined code needs to reset it before watchdog barks. Otherwise it would make system reboot.
*
* @param[in] timeout_ms The timeout value that watchdog barks. The maximum value is 8 seconds.
*/
Expand Down
4 changes: 2 additions & 2 deletions Arduino_package/hardware/cores/ambd/wl_definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
#define WL_IPV4_LENGTH 4
// Maximum size of a SSID list
#define WL_NETWORKS_LIST_MAXNUM 50
// Maxmium number of socket
// Maximum number of socket
#define MAX_SOCK_NUM 4
// Socket not available constant
#define SOCK_NOT_AVAIL 255
// Default state value for Wifi state field
#define NA_STATE -1
//Maximum number of attempts to establish wifi connection
// Maximum number of attempts to establish wifi connection
#define WL_MAX_ATTEMPT_CONNECTION 10

typedef enum {
Expand Down
2 changes: 1 addition & 1 deletion Arduino_package/hardware/libraries/Analog/src/AmebaServo.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
disabled when the first servo is attached.
Timers are seized as needed in groups of 12 servos - 24 servos use two
timers, 48 servos will use four.
The sequence used to sieze timers is defined in timers.h
The sequence used to seize timers is defined in timers.h
The methods are:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void setup() {
}

void loop() {
// if received data is avaliable and transmit data buffer is avaliable for write
// if received data is available and transmit data buffer is available for write
if(Codec.writeAvaliable() && Codec.readAvaliable()) {
Codec.readDataPage(buffer, SAMPLECOUNT); // read latest received data from buffer
Codec.writeDataPage(buffer, SAMPLECOUNT); // write latest data into transmit data buffer
Expand Down
10 changes: 5 additions & 5 deletions Arduino_package/hardware/libraries/AudioCodec/src/AudioCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ void AudioCodec::callback_task(void* param) {
vTaskDelete(NULL);
}

// Check for presence of a free Tx buffer page avaliable for data write
// Returns pointer to first byte of buffer if avaliable
// Check for presence of a free Tx buffer page available for data write
// Returns pointer to first byte of buffer if available
uint8_t* AudioCodec::getFreeTxPage(void) {
TX_BLOCK* ptx_block = &(_txBufferInfo.tx_block[_txBufferInfo.tx_usr_cnt]);

Expand Down Expand Up @@ -455,7 +455,7 @@ void AudioCodec::releaseTxPage(void) {
}

// Check for presence of a Tx buffer page with user data ready for GDMA transfer
// Returns pointer to first byte of buffer if avaliable
// Returns pointer to first byte of buffer if available
// Otherwise returns pointer to buffer of zeros, (no data output)
uint8_t* AudioCodec::getReadyTxPage(void) {
TX_BLOCK* ptx_block = &(_txBufferInfo.tx_block[_txBufferInfo.tx_gdma_cnt]);
Expand Down Expand Up @@ -483,7 +483,7 @@ uint32_t AudioCodec::getReadyTxLength(void) {
}

// Check for presence of a Rx buffer page with data ready for user read
// Returns pointer to first byte of buffer if avaliable
// Returns pointer to first byte of buffer if available
uint8_t* AudioCodec::getReadyRxPage(void) {
RX_BLOCK* prx_block = &(_rxBufferInfo.rx_block[_rxBufferInfo.rx_usr_cnt]);

Expand Down Expand Up @@ -526,7 +526,7 @@ void AudioCodec::releaseRxPage(void) {
}

// Check for presence of a Rx buffer page ready for GDMA transfer of new data
// Returns pointer to first byte of buffer if avaliable
// Returns pointer to first byte of buffer if available
// Otherwise returns pointer to overflow buffer, (new data lost)
uint8_t* AudioCodec::getFreeRxPage(void) {
RX_BLOCK* prx_block = &(_rxBufferInfo.rx_block[_rxBufferInfo.rx_gdma_cnt]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class AudioCodec {
static void initHAL();
static void deinitHAL();

// Function for checking for avaliable audio data and calling callback functions
// Function for checking for available audio data and calling callback functions
static void callback_task(void* param);

// Functions for accessing and managing DMA buffer use
Expand Down
2 changes: 1 addition & 1 deletion Arduino_package/hardware/libraries/AudioCodec/src/FFT.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class FFT {
void calculate(float* inputBuf, float* outputBuf, uint16_t sampleCount);
void calculate(int16_t* inputBuf, float* outputBuf, uint16_t sampleCount);

// Get the corresponding FFT frequency bins for a given smaple rate and sample count
// Get the corresponding FFT frequency bins for a given sample rate and sample count
void getFrequencyBins(uint16_t* outputBuf, uint16_t sampleCount, uint32_t sampleRate);
uint16_t getFFTSize(uint16_t sampleCount);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ uint32_t PlaybackWav::readAudioData(int8_t* dst, uint32_t len) {
memset(dst, 0, len);
return 0;
}
// Check if requested data is less than remaing data
// Check if requested data is less than remaining data
if (len > (f_size(&_file) - f_tell(&_file))) {
memset(dst, 0, len);
}
Expand Down
2 changes: 1 addition & 1 deletion Arduino_package/hardware/libraries/BLE/src/BLEAddr.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class BLEAddr {
public:
BLEAddr();
BLEAddr(uint8_t (&addr)[6]);
BLEAddr(const char * str); // Build a BLEAddr object from an address string. Use of colons (:) to seperate address bytes in the string is acceptable.
BLEAddr(const char * str); // Build a BLEAddr object from an address string. Use of colons (:) to separate address bytes in the string is acceptable.
const char* str();
uint8_t* data();
bool operator ==(const BLEAddr &addr);
Expand Down
4 changes: 2 additions & 2 deletions Arduino_package/hardware/libraries/BLE/src/BLEAdvertData.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class BLEAdvertData {
uint8_t addShortName(const char* str);
uint8_t addCompleteName(const char* str);

// Methods used for processing received advertisments
// Methods used for processing received advertisements
void parseScanInfo(T_LE_CB_DATA *p_data);

bool hasFlags();
Expand All @@ -56,7 +56,7 @@ class BLEAdvertData {
uint8_t _data[31] ={0}; // array for storing formatted advertising data for receiving and sending
uint8_t _dataSize = 0;

// Variables used for processing received advertisments
// Variables used for processing received advertisements
T_GAP_ADV_EVT_TYPE _advType;
T_GAP_REMOTE_ADDR_TYPE _addrType;
BLEAddr _address;
Expand Down
6 changes: 3 additions & 3 deletions Arduino_package/hardware/libraries/BLE/src/BLEDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void BLEDevice::deinit() {
bte_deinit();
bt_trace_uninit();
memset(&_gapDevState, 0, sizeof(T_GAP_DEV_STATE));
printf("BT Stack deinitalized\r\n");
printf("BT Stack deinitialized\r\n");
}
}

Expand All @@ -120,8 +120,8 @@ bool BLEDevice::connected(uint8_t connId) {

// set BLE GAP device name
// other devices will see this name after connection is established
// note: this is seperate from the device name sent in advertising packets
// note: this name and advertised name can be different, but ideally should be set as indentical
// note: this is separate from the device name sent in advertising packets
// note: this name and advertised name can be different, but ideally should be set as identical
void BLEDevice::setDeviceName(String devName) {
// Set the Device Name in GAP, which will be visible after a connection is established
if (devName.length() > GAP_DEVICE_NAME_LEN) {
Expand Down
2 changes: 1 addition & 1 deletion Arduino_package/hardware/libraries/BLE/src/BLEDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class BLEDevice {
void beginCentral(uint8_t connCount = BLE_CENTRAL_APP_MAX_LINKS);
void beginPeripheral();
void end();
void getLocalAddr(uint8_t (&addr)[GAP_BD_ADDR_LEN]); // Local address is only avaliable after peripheral or central mode is started
void getLocalAddr(uint8_t (&addr)[GAP_BD_ADDR_LEN]); // Local address is only available after peripheral or central mode is started
void configServer(uint8_t maxServiceCount);
void addService(BLEService& newService);
void configClient();
Expand Down
2 changes: 1 addition & 1 deletion Arduino_package/hardware/libraries/BLE/src/BLEUUID.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class BLEUUID {
public:
BLEUUID();
BLEUUID(const char* str); // Build a BLEUUID object from an UUID string. Use of hyphens (-) to seperate UUID sections in the string is acceptable.
BLEUUID(const char* str); // Build a BLEUUID object from an UUID string. Use of hyphens (-) to separate UUID sections in the string is acceptable.
BLEUUID(uint8_t* data, uint8_t length);
const char* str();
const uint8_t* data();
Expand Down
2 changes: 1 addition & 1 deletion Arduino_package/hardware/libraries/BLE/src/HID.h
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ enum
HID_COLLECTION ( HID_COLLECTION_APPLICATION ) ,\
/* Report ID if any */\
__VA_ARGS__ \
/* 8 bits Modifier Keys (Shfit, Control, Alt) */ \
/* 8 bits Modifier Keys (Shift, Control, Alt) */ \
HID_USAGE_PAGE ( HID_USAGE_PAGE_KEYBOARD ) ,\
HID_USAGE_MIN ( 224 ) ,\
HID_USAGE_MAX ( 231 ) ,\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void loop() {
}
// close the connection:
client.stop();
Serial.println("client disonnected");
Serial.println("client disconnected");
}
}

Expand Down
Loading

0 comments on commit 84a9d07

Please sign in to comment.