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 4557c9d commit 9f641cb
Show file tree
Hide file tree
Showing 49 changed files with 133 additions and 105 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/spell_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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/Adafruit_GPS.cpp,Arduino_package/hardware/libraries/SoftwareSerial/Adafruit_GPS.h,Arduino_package/hardware/libraries/SoftwareSerial/SoftwareSerial.cpp,Arduino_package/hardware/libraries/SoftwareSerial/SoftwareSerial.h
# DHT.cpp - celcius
ignore_words_list: ameba,celcius
# ignore_words_file: Ameba_misc/Spell_Check_Ignore/.codespellignore
path: ${{ matrix.path }}
2 changes: 1 addition & 1 deletion Arduino_package/hardware/cores/arduino/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ typedef struct _PinDescription

} 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/arduino/PowerManagement.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class PowerManagementClass {
* then he would find it's hard to flash image.
* In this case, he can pull up pin 18.
*
* @return true if system not allowed enter any power save state, and false vise versa
* @return true if system not allowed enter any power save state, and false vice versa
*/
static bool safeLock();

Expand Down
2 changes: 1 addition & 1 deletion Arduino_package/hardware/cores/arduino/Stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,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/arduino/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/arduino/WString.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,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 @@ -152,7 +152,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/arduino/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)
{
Expand Down
2 changes: 1 addition & 1 deletion Arduino_package/hardware/cores/arduino/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
2 changes: 1 addition & 1 deletion Arduino_package/hardware/cores/arduino/wifi_drv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ int8_t WiFiDrv::wifiSetKey(char* ssid, uint8_t ssid_len, uint8_t key_idx, const
wifi.security_type = RTW_SECURITY_WEP_PSK;
memset(password, 0, sizeof(password));

// convert hex sring to hex value
// convert hex string to hex value
for (i=0, idx=0; i<len; i++) {

if ( k[i] >= '0' && k[i] <= '9' ) {
Expand Down
10 changes: 5 additions & 5 deletions Arduino_package/hardware/cores/arduino/wifi_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,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 @@ -77,10 +77,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 @@ -90,10 +90,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/arduino/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/arduino/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(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 can transfer exection right to
* higher priority immediately without waiting for the ending of current 1 millisecond, then invoke os_thread_yield 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/arduino/wiring_watchdog.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extern void wdt_reset();
* @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/arduino/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/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
10 changes: 5 additions & 5 deletions Arduino_package/hardware/libraries/Audio/Alexa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static i2s_t i2s_obj;
/**
* The wakeup pin.
*
* When ALC5680 reconize the wakeup word it will toggle this pin
* When ALC5680 recognize the wakeup word it will toggle this pin
*/
#define GPIO_IRQ_VOICE_PIN PC_5
static gpio_irq_t gpio_audio;
Expand Down Expand Up @@ -94,7 +94,7 @@ static gtimer_t timer_led;

// The mp3 download from AVS has 1152 bytes decoded in each frame
#define ALEXA_I2S_DMA_PAGE_SIZE 1152
#define ALEXA_I2S_DMA_PAGE_NUM 4 // Vaild number is 2~4
#define ALEXA_I2S_DMA_PAGE_NUM 4 // Valid number is 2~4

// DMA buffer for I2S
SDRAM_BSS_SECTION static uint8_t i2s_tx_buf[ALEXA_I2S_DMA_PAGE_SIZE*ALEXA_I2S_DMA_PAGE_NUM];
Expand Down Expand Up @@ -134,7 +134,7 @@ static xQueueHandle content_queue;
* Cached mp3 data.
*
* When play mp3 data, the source data may not complete and need further data to decode.
* We use this varaible to cache the un-decoded data
* We use this variable to cache the un-decoded data
*/
#define DIALOG_DATA_CACHE_SIZE (16384+4096)
uint32_t dialog_data_len = 0;
Expand Down Expand Up @@ -246,7 +246,7 @@ static void init_alexa_i2s()
}

/**
* The Audio callback fucntion as AVS audio part is ready for initiialize.
* The Audio callback function as AVS audio part is ready for initialize.
*/
static void init_audio_codec()
{
Expand Down Expand Up @@ -460,7 +460,7 @@ static void do_alert()
}

if ((ptx_buf = i2s_get_tx_page(&i2s_obj)) == NULL) {
// alerts has less priorty than dialog. We should break here to check if we have dialog came in
// alerts has less priority than dialog. We should break here to check if we have dialog came in
vTaskDelay(ALEXA_AUDIO_I2S_TX_BUF_DELAY);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Realtek Audio Shield (ALC5680) x1
Speaker x1
This sketch requre I2S interface.
This sketch require I2S interface.
According to Teensy Audio Shield pinout, we connect pins as below:
Ameba Audio Shield
Expand Down
14 changes: 7 additions & 7 deletions Arduino_package/hardware/libraries/Fatfs/SdFatFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class SdFatFile : public Stream {
* @brief Write one byte to file
*
* @param[in] c The character to be written
* @return The succeessful written byte count
* @return The successful written byte count
*/
virtual size_t write(uint8_t c);

Expand All @@ -39,7 +39,7 @@ class SdFatFile : public Stream {
*
* @param[in] buf The buffer to be written
* @param[in] size The length of buffer to be written
* @return The succeessful written byte count
* @return The successful written byte count
*/
virtual size_t write(const uint8_t *buf, size_t size);

Expand All @@ -51,16 +51,16 @@ class SdFatFile : public Stream {
virtual int read();

/**
* @brief Read one byte from file without move curser
* @brief Read one byte from file without move cursor
*
* @return The read character
*/
virtual int peek();

/**
* @brief Check if curser is at EOF
* @brief Check if cursor is at EOF
*
* @return Return 1 if is not at EOF. And 0 vise versa.
* @return Return 1 if is not at EOF. And 0 vice versa.
*/
virtual int available();

Expand All @@ -83,12 +83,12 @@ class SdFatFile : public Stream {
*
* @param[in] buf The buffer to store the content
* @param[in] nbyte The buffer size. (Or can be regarded as desired length to read)
* @return The succeessful written byte count
* @return The successful written byte count
*/
int read(void *buf, uint16_t nbyte);

/**
* @brief Change curser to sepcific position
* @brief Change cursor to specific position
*
* @param[in] pos The desired position
* @return Return 0 if success. Return negative value if failure.
Expand Down
8 changes: 4 additions & 4 deletions Arduino_package/hardware/libraries/Fatfs/SdFatFs.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class SdFatFs
* @brief List items under specific folder
*
* List items under specific folder and store the result in the buffer that user specified.
* Each item are seperated by '\0'.
* Each item are separated by '\0'.
*
* @param[in] path The absolute directory path to be listed
* @param[in] result_buf The buffer to be stored results
Expand Down Expand Up @@ -79,15 +79,15 @@ class SdFatFs
* @brief Check if a specific path is a directory
*
* @param[in] absolute_path The absolute path to be queried
* @return Return 1 if it is directory. And 0 vise versa.
* @return Return 1 if it is directory. And 0 vice versa.
*/
unsigned char isDir(char *absolute_path);

/**
* @brief Check if a specific path is a file
*
* @param[in] absolute_path The absolute path to be queried
* @return Return 1 if it is file. And 0 vise versa.
* @return Return 1 if it is file. And 0 vice versa.
*/
unsigned char isFile(char *absolute_path);

Expand Down Expand Up @@ -132,7 +132,7 @@ class SdFatFs
/**
* @brief Return current status of SD
*
* @return Return 1 if ready to use. Return 0 if status is inactivate or abnormal.
* @return Return 1 if ready to use. Return 0 if status is not activate or abnormal.
*/
int status();

Expand Down
6 changes: 3 additions & 3 deletions Arduino_package/hardware/libraries/FlashMemory/FlashMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
* @brief The default flash address for application usage
*
* This is reference flash address that user can use.
* If user use flash address overwirte image address, the it would corrupt image content.
* If user use flash address overwrite image address, the it would corrupt image content.
**/
#define FLASH_MEMORY_APP_BASE 0xFF000

/**
* @class FlashMemoryClass FlashMemory.h
* @brief Flash memory api
*
* There are 2 ways to operate memroy in this class. \n
* There are 2 ways to operate memory in this class. \n
* The first one is to allocate a buf and mirror the content of flash. We operate this buf and update flash when needed.
* In this way we can reduce flash memory operation since it cost time. \n
* The second one is write to flash immediately. It would cost time but save buf.
Expand Down Expand Up @@ -68,7 +68,7 @@ class FlashMemoryClass
/**
* @brief Read fore bytes from flash memory
*
* Read 4 byte from specifc offet based on base address.
* Read 4 byte from specific offset based on base address.
*
* @param[in] offset The offset according to base address
* @return the read data with size of 4 bytes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
This sketch shows how to request flash memory larger than defaut 4K, and read/write one specific word.
This sketch shows how to request flash memory larger than default 4K, and read/write one specific word.
*/

#include <FlashMemory.h>
Expand Down
2 changes: 1 addition & 1 deletion Arduino_package/hardware/libraries/GPIO/DHT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ boolean DHT::read(bool force) {
// Send start signal. See DHT datasheet for full signal diagram:
// http://www.adafruit.com/datasheets/Digital%20humidity%20and%20temperature%20sensor%20AM2302.pdf

// Go into high impedence state to let pull-up raise data line level and
// Go into high impedance state to let pull-up raise data line level and
// start the reading process.
digitalWrite(_pin, HIGH);
delay(250);
Expand Down
Loading

0 comments on commit 9f641cb

Please sign in to comment.