Merge pull request #7751 from hathach/add-codespell
Add codespell to pre-commit to scan and fix typo
This commit is contained in:
commit
0639c0850f
7
.codespell/exclude-file.txt
Normal file
7
.codespell/exclude-file.txt
Normal file
@ -0,0 +1,7 @@
|
||||
#define MICROPY_HW_BOARD_NAME "BLOK"
|
||||
USB_PRODUCT = "BLOK"
|
||||
uint32_t THI = (*(uint32_t *)FUSES_HOT_TEMP_VAL_INT_ADDR & FUSES_HOT_TEMP_VAL_INT_Msk) >> FUSES_HOT_TEMP_VAL_INT_Pos;
|
||||
float TH = THI + convert_dec_to_frac(THD);
|
||||
print(binascii.b2a_base64(b"fo"))
|
||||
# again, neither will "there" or "wither", since they have "the"
|
||||
i1Qb$TE"rl
|
22
.codespell/ignore-words.txt
Normal file
22
.codespell/ignore-words.txt
Normal file
@ -0,0 +1,22 @@
|
||||
ans
|
||||
ure
|
||||
clen
|
||||
ser
|
||||
endianess
|
||||
pris
|
||||
synopsys
|
||||
reenable
|
||||
dout
|
||||
inout
|
||||
wel
|
||||
iput
|
||||
hsi
|
||||
astroid
|
||||
busses
|
||||
cyphertext
|
||||
dum
|
||||
deque
|
||||
deques
|
||||
extint
|
||||
shs
|
||||
pass-thru
|
10
.codespellrc
Normal file
10
.codespellrc
Normal file
@ -0,0 +1,10 @@
|
||||
# See: https://github.com/codespell-project/codespell#using-a-config-file
|
||||
[codespell]
|
||||
# In the event of a false positive, add the problematic word, in all lowercase, to 'ignore-words.txt' (one word per line).
|
||||
# Or copy & paste the whole problematic line to 'exclude-file.txt'
|
||||
ignore-words = .codespell/ignore-words.txt
|
||||
exclude-file = .codespell/exclude-file.txt
|
||||
check-filenames =
|
||||
check-hidden =
|
||||
count =
|
||||
skip = .cproject,.git,./lib,./locale,ACKNOWLEDGEMENTS
|
@ -11,6 +11,16 @@ repos:
|
||||
exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|ports/espressif/esp-idf-config/.*|ports/espressif/boards/.*/sdkconfig)'
|
||||
- id: trailing-whitespace
|
||||
exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|lib/mbedtls_errors/.*)'
|
||||
- repo: https://github.com/codespell-project/codespell
|
||||
rev: v2.2.4
|
||||
hooks:
|
||||
- id: codespell
|
||||
args: [-w]
|
||||
exclude: |
|
||||
(?x)^(
|
||||
locale/|
|
||||
lib/
|
||||
)
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: translations
|
||||
|
@ -483,7 +483,7 @@ mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t
|
||||
|
||||
if (self->scan_results != NULL) {
|
||||
if (!shared_module_bleio_scanresults_get_done(self->scan_results)) {
|
||||
mp_raise_bleio_BluetoothError(translate("Scan already in progess. Stop with stop_scan."));
|
||||
mp_raise_bleio_BluetoothError(translate("Scan already in progress. Stop with stop_scan."));
|
||||
}
|
||||
self->scan_results = NULL;
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ typedef struct _bleio_adapter_obj_t {
|
||||
uint16_t manufacturer;
|
||||
uint16_t lmp_subversion;
|
||||
|
||||
// Used to monitor advertising timeout for legacy avertising.
|
||||
// Used to monitor advertising timeout for legacy advertising.
|
||||
uint64_t advertising_start_ticks;
|
||||
uint64_t advertising_timeout_msecs; // If zero, do not check.
|
||||
|
||||
|
@ -515,7 +515,7 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern
|
||||
// (gattc_char->char_props.write ? CHAR_PROP_WRITE : 0) |
|
||||
// (gattc_char->char_props.write_wo_resp ? CHAR_PROP_WRITE_NO_RESPONSE : 0);
|
||||
|
||||
// // Call common_hal_bleio_characteristic_construct() to initalize some fields and set up evt handler.
|
||||
// // Call common_hal_bleio_characteristic_construct() to initialize some fields and set up evt handler.
|
||||
// common_hal_bleio_characteristic_construct(
|
||||
// characteristic, m_char_discovery_service, gattc_char->handle_value, uuid,
|
||||
// props, SECURITY_MODE_OPEN, SECURITY_MODE_OPEN,
|
||||
|
@ -96,7 +96,7 @@ STATIC uint8_t bleio_properties_to_ble_spec_properties(uint8_t bleio_properties)
|
||||
return ble_spec_properties;
|
||||
}
|
||||
|
||||
// FIX not currently used; reenable when used.
|
||||
// FIX not currently used; re-enable when used.
|
||||
#if 0
|
||||
STATIC uint8_t ble_spec_properties_to_bleio_properties(uint8_t ble_spec_properties) {
|
||||
uint8_t bleio_properties = 0;
|
||||
@ -964,7 +964,7 @@ static void process_read_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t d
|
||||
// Keep track of the first one to make sure.
|
||||
size_t sizeof_first_service_uuid = 0;
|
||||
|
||||
// Size of a single bt_att_group_data chunk. Start with the intial size, and
|
||||
// Size of a single bt_att_group_data chunk. Start with the initial size, and
|
||||
// add the uuid size in the loop below.
|
||||
size_t data_length = sizeof(struct bt_att_group_data);
|
||||
|
||||
|
@ -150,7 +150,7 @@ struct bt_att_read_mult_req {
|
||||
uint16_t handles[];
|
||||
} __packed;
|
||||
|
||||
/* Read Multiple Respose */
|
||||
/* Read Multiple Response */
|
||||
#define BT_ATT_OP_READ_MULT_RSP 0x0f
|
||||
struct bt_att_read_mult_rsp {
|
||||
uint8_t _dummy[0];
|
||||
@ -243,7 +243,7 @@ struct bt_att_read_mult_vl_req {
|
||||
uint16_t handles[];
|
||||
} __packed;
|
||||
|
||||
/* Read Multiple Respose */
|
||||
/* Read Multiple Response */
|
||||
#define BT_ATT_OP_READ_MULT_VL_RSP 0x21
|
||||
struct bt_att_read_mult_vl_rsp {
|
||||
uint16_t len;
|
||||
|
@ -88,7 +88,7 @@ mp_obj_t mpy_init(mp_obj_fun_bc_t *self, size_t n_args, size_t n_kw, mp_obj_t *a
|
||||
// This must be first, it sets up the globals dict and other things
|
||||
MP_DYNRUNTIME_INIT_ENTRY
|
||||
|
||||
// Messages can be printed as usualy
|
||||
// Messages can be printed as usually
|
||||
mp_printf(&mp_plat_print, "initialising module self=%p\n", self);
|
||||
|
||||
// Make the functions available in the module's namespace
|
||||
|
@ -180,10 +180,6 @@ msgstr ""
|
||||
msgid "%q must be >= %d"
|
||||
msgstr ""
|
||||
|
||||
#: ports/espressif/common-hal/analogbufio/BufferedIn.c
|
||||
msgid "%q must be array of type 'H'"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/analogbufio/BufferedIn.c
|
||||
msgid "%q must be a bytearray or array of type 'H' or 'B'"
|
||||
msgstr ""
|
||||
@ -192,6 +188,10 @@ msgstr ""
|
||||
msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'"
|
||||
msgstr ""
|
||||
|
||||
#: ports/espressif/common-hal/analogbufio/BufferedIn.c
|
||||
msgid "%q must be array of type 'H'"
|
||||
msgstr ""
|
||||
|
||||
#: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c
|
||||
#: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c
|
||||
msgid "%q must be of type %q or %q, not %q"
|
||||
@ -1221,7 +1221,8 @@ msgstr ""
|
||||
msgid "Interrupt error."
|
||||
msgstr ""
|
||||
|
||||
#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c
|
||||
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c
|
||||
#: shared-bindings/digitalio/DigitalInOut.c
|
||||
#: shared-bindings/displayio/EPaperDisplay.c
|
||||
msgid "Invalid %q"
|
||||
msgstr ""
|
||||
@ -1519,10 +1520,6 @@ msgstr ""
|
||||
msgid "No in or out in program"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/aesio/aes.c
|
||||
msgid "No key was specified"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/time/__init__.c
|
||||
msgid "No long integer support"
|
||||
msgstr ""
|
||||
@ -1935,7 +1932,7 @@ msgstr ""
|
||||
|
||||
#: ports/espressif/common-hal/_bleio/Adapter.c
|
||||
#: ports/nrf/common-hal/_bleio/Adapter.c
|
||||
msgid "Scan already in progess. Stop with stop_scan."
|
||||
msgid "Scan already in progress. Stop with stop_scan."
|
||||
msgstr ""
|
||||
|
||||
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
|
||||
@ -2248,6 +2245,11 @@ msgstr ""
|
||||
msgid "Unknown BLE error: %d"
|
||||
msgstr ""
|
||||
|
||||
#: ports/raspberrypi/common-hal/wifi/__init__.c
|
||||
#, c-format
|
||||
msgid "Unknown error code %d"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/wifi/Radio.c
|
||||
#, c-format
|
||||
msgid "Unknown failure %d"
|
||||
@ -2283,11 +2285,6 @@ msgstr ""
|
||||
msgid "Unknown system firmware error: %d"
|
||||
msgstr ""
|
||||
|
||||
#: ports/raspberrypi/common-hal/wifi/__init__.c
|
||||
#, c-format
|
||||
msgid "Unkown error code %d"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/adafruit_pixelbuf/PixelBuf.c
|
||||
#: shared-module/_pixelmap/PixelMap.c
|
||||
#, c-format
|
||||
@ -2740,7 +2737,7 @@ msgstr ""
|
||||
msgid "can't set attribute"
|
||||
msgstr ""
|
||||
|
||||
#: py/runtime.c
|
||||
#: py/runtime.c shared-bindings/supervisor/Runtime.c
|
||||
msgid "can't set attribute '%q'"
|
||||
msgstr ""
|
||||
|
||||
@ -3040,8 +3037,8 @@ msgid "extra positional arguments given"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c
|
||||
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c
|
||||
#: shared-module/gifio/GifWriter.c
|
||||
#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c
|
||||
#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c
|
||||
msgid "file must be a file opened in byte mode"
|
||||
msgstr ""
|
||||
|
||||
@ -4114,10 +4111,6 @@ msgstr ""
|
||||
msgid "tobytes can be invoked for dense arrays only"
|
||||
msgstr ""
|
||||
|
||||
#: shared-module/struct/__init__.c
|
||||
msgid "too many arguments provided with the given format"
|
||||
msgstr ""
|
||||
|
||||
#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c
|
||||
msgid "too many dimensions"
|
||||
msgstr ""
|
||||
|
@ -49,7 +49,7 @@
|
||||
#define CONF_TC3_WAVE_DUTY_VAL 0x1f4
|
||||
#endif
|
||||
|
||||
/* Caculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */
|
||||
/* Calculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */
|
||||
#if CONF_TC3_PRESCALER < TC_CTRLA_PRESCALER_DIV64_Val
|
||||
#define CONF_TC3_CC0 \
|
||||
((uint32_t)(((double)CONF_TC3_WAVE_PER_VAL * CONF_GCLK_TC3_FREQUENCY) / 1000000 / (1 << CONF_TC3_PRESCALER) - 1))
|
||||
|
@ -42,7 +42,7 @@
|
||||
#define CONF_TC0_WAVE_DUTY_VAL 0x1f4
|
||||
#endif
|
||||
|
||||
/* Caculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */
|
||||
/* Calculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */
|
||||
#if CONF_TC0_PRESCALER < TC_CTRLA_PRESCALER_DIV64_Val
|
||||
#define CONF_TC0_CC0 \
|
||||
((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 1000000 / (1 << CONF_TC0_PRESCALER) - 1))
|
||||
|
@ -42,7 +42,7 @@
|
||||
#define CONF_TC0_WAVE_DUTY_VAL 0x1f4
|
||||
#endif
|
||||
|
||||
/* Caculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */
|
||||
/* Calculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */
|
||||
#if CONF_TC0_PRESCALER < TC_CTRLA_PRESCALER_DIV64_Val
|
||||
#define CONF_TC0_CC0 \
|
||||
((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 1000000 / (1 << CONF_TC0_PRESCALER) - 1))
|
||||
|
@ -42,7 +42,7 @@
|
||||
#define CONF_TC0_WAVE_DUTY_VAL 0x1f4
|
||||
#endif
|
||||
|
||||
/* Caculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */
|
||||
/* Calculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */
|
||||
#if CONF_TC0_PRESCALER < TC_CTRLA_PRESCALER_DIV64_Val
|
||||
#define CONF_TC0_CC0 \
|
||||
((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 1000000 / (1 << CONF_TC0_PRESCALER) - 1))
|
||||
|
@ -51,7 +51,7 @@ uint8_t display_init_sequence[] = {
|
||||
0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V
|
||||
0x2a, 0, // _INVOFF
|
||||
0x36, 1, 0x18, // _MADCTL bottom to top refresh
|
||||
// 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie,
|
||||
// 1 clk cycle nonoverlap, 2 cycle gate rise, 3 cycle osc equalie,
|
||||
// fix on VTL
|
||||
0x3a, 1, 0x05, // COLMOD - 16bit color
|
||||
0xe0, 16, 0x02, 0x1c, 0x07, 0x12, // _GMCTRP1 Gamma
|
||||
|
@ -50,7 +50,7 @@ uint8_t display_init_sequence[] = {
|
||||
0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V
|
||||
0x2a, 0, // _INVOFF
|
||||
0x36, 1, 0b10100000, // _MADCTL for rotation 0
|
||||
// 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie,
|
||||
// 1 clk cycle nonoverlap, 2 cycle gate rise, 3 cycle osc equalie,
|
||||
// fix on VTL
|
||||
0x3a, 1, 0x05, // COLMOD - 16bit color
|
||||
0xe0, 16, 0x02, 0x1c, 0x07, 0x12, // _GMCTRP1 Gamma
|
||||
|
@ -52,7 +52,7 @@ uint8_t display_init_sequence[] = {
|
||||
0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V
|
||||
0x2a, 0, // _INVOFF
|
||||
0x36, 1, 0b10100000, // _MADCTL for rotation 0
|
||||
// 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie,
|
||||
// 1 clk cycle nonoverlap, 2 cycle gate rise, 3 cycle osc equalie,
|
||||
// fix on VTL
|
||||
0x3a, 1, 0x05, // COLMOD - 16bit color
|
||||
0xe0, 16, 0x02, 0x1c, 0x07, 0x12, // _GMCTRP1 Gamma
|
||||
|
@ -52,7 +52,7 @@ uint8_t display_init_sequence[] = {
|
||||
0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V
|
||||
0x2a, 0, // _INVOFF
|
||||
0x36, 1, 0xa8, // _MADCTL bottom to top refresh
|
||||
// 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie,
|
||||
// 1 clk cycle nonoverlap, 2 cycle gate rise, 3 cycle osc equalie,
|
||||
// fix on VTL
|
||||
0x3a, 1, 0x05, // COLMOD - 16bit color
|
||||
0xe0, 16, 0x02, 0x1c, 0x07, 0x12, // _GMCTRP1 Gamma
|
||||
|
@ -36,7 +36,7 @@ STATIC volatile bool woke_up = false;
|
||||
STATIC mp_float_t wakeup_time;
|
||||
|
||||
void common_hal_alarm_time_timealarm_construct(alarm_time_timealarm_obj_t *self, mp_float_t monotonic_time) {
|
||||
// TODO: when issueing light/seep sleep, throw a ValueError if the
|
||||
// TODO: when issuing light/seep sleep, throw a ValueError if the
|
||||
// time exceeds the maximum value. For light sleep, max =
|
||||
// 2**32 / 16384 = 3 days. For deep sleep, max = 2**32 / 32
|
||||
// = 1550 days.
|
||||
|
@ -482,7 +482,7 @@ uint32_t common_hal_frequencyio_frequencyin_get_item(frequencyio_frequencyin_obj
|
||||
float time_each_event = self->factor / self->frequency; // get the time for each event during actual period
|
||||
float capture_diff = self->factor - self->capture_period; // get the difference of actual and base periods
|
||||
// we only need to adjust if the capture_diff can contain 1 or more events
|
||||
// if so, we add how many events could have occured during the diff time
|
||||
// if so, we add how many events could have occurred during the diff time
|
||||
if (time_each_event > capture_diff) {
|
||||
frequency_adjustment = capture_diff / time_each_event;
|
||||
}
|
||||
|
@ -189,7 +189,7 @@
|
||||
// - firmware
|
||||
// - internal CIRCUITPY flash filesystem (optional)
|
||||
// - internal config, used to store crystalless clock calibration info (optional)
|
||||
// - microntroller.nvm (optional)
|
||||
// - microcontroller.nvm (optional)
|
||||
|
||||
// Define these regions starting up from the bottom of flash:
|
||||
|
||||
|
@ -1073,7 +1073,7 @@ static void sd_mmc_deselect_slot(void) {
|
||||
* \note
|
||||
* This function runs the initialization procedure and the identification
|
||||
* process, then it sets the SD/MMC card in transfer state.
|
||||
* At last, it will automaticly enable maximum bus width and transfer speed.
|
||||
* At last, it will automatically enable maximum bus width and transfer speed.
|
||||
*
|
||||
* \return true if success, otherwise false
|
||||
*/
|
||||
@ -1205,7 +1205,7 @@ static bool sd_mmc_mci_card_init(void) {
|
||||
* \note
|
||||
* This function runs the initialization procedure and the identification
|
||||
* process, then it sets the SD/MMC card in transfer state.
|
||||
* At last, it will automaticly enable maximum bus width and transfer speed.
|
||||
* At last, it will automatically enable maximum bus width and transfer speed.
|
||||
*
|
||||
* \return true if success, otherwise false
|
||||
*/
|
||||
@ -1270,7 +1270,7 @@ static bool sd_mmc_mci_install_mmc(void) {
|
||||
uint8_t retry = 10;
|
||||
while (retry--) {
|
||||
/* Retry is a WORKAROUND for no compliance card (Atmel Internal ref. MMC19):
|
||||
* These cards seem not ready immediatly
|
||||
* These cards seem not ready immediately
|
||||
* after the end of busy of mmc_cmd6_set_high_speed()*/
|
||||
|
||||
/* Set default block size */
|
||||
@ -1427,7 +1427,7 @@ sd_mmc_err_t sd_mmc_wait_end_of_read_blocks(bool abort) {
|
||||
return SD_MMC_OK;
|
||||
}
|
||||
|
||||
/* All blocks are transfered then stop read operation */
|
||||
/* All blocks are transferred then stop read operation */
|
||||
if (sd_mmc_nb_block_to_tranfer == 1) {
|
||||
/* Single block transfer, then nothing to do */
|
||||
sd_mmc_deselect_slot();
|
||||
@ -1506,7 +1506,7 @@ sd_mmc_err_t sd_mmc_wait_end_of_write_blocks(bool abort) {
|
||||
return SD_MMC_OK;
|
||||
}
|
||||
|
||||
/* All blocks are transfered then stop write operation */
|
||||
/* All blocks are transferred then stop write operation */
|
||||
if (sd_mmc_nb_block_to_tranfer == 1) {
|
||||
/* Single block transfer, then nothing to do */
|
||||
sd_mmc_deselect_slot();
|
||||
|
@ -67,7 +67,7 @@ typedef uint8_t sd_mmc_err_t; /**< Type of return error code */
|
||||
#define SD_MMC_INIT_ONGOING 1 /**< Card not initialized */
|
||||
#define SD_MMC_ERR_NO_CARD 2 /**< No SD/MMC card inserted */
|
||||
#define SD_MMC_ERR_UNUSABLE 3 /**< Unusable card */
|
||||
#define SD_MMC_ERR_SLOT 4 /**< Slot unknow */
|
||||
#define SD_MMC_ERR_SLOT 4 /**< Slot unknown */
|
||||
#define SD_MMC_ERR_COMM 5 /**< General communication error */
|
||||
#define SD_MMC_ERR_PARAM 6 /**< Illeage input parameter */
|
||||
#define SD_MMC_ERR_WP 7 /**< Card write protected */
|
||||
@ -166,7 +166,7 @@ uint32_t sd_mmc_get_capacity(uint8_t slot);
|
||||
*
|
||||
* \param[in] slot Card slot
|
||||
*
|
||||
* \return true, if write portected
|
||||
* \return true, if write protected
|
||||
*/
|
||||
bool sd_mmc_is_write_protected(uint8_t slot);
|
||||
|
||||
|
@ -73,8 +73,8 @@ extern "C" {
|
||||
* Responses types:
|
||||
*
|
||||
* R1, R3, R4 & R5 use a 48 bits response protected by a 7bit CRC checksum
|
||||
* - R1 receiv data not specified
|
||||
* - R3 receiv OCR
|
||||
* - R1 receive data not specified
|
||||
* - R3 receive OCR
|
||||
* - R4, R5 RCA management (MMC only)
|
||||
* - R6, R7 RCA management (SD only)
|
||||
*
|
||||
@ -115,14 +115,14 @@ typedef uint32_t sdmmc_cmd_def_t;
|
||||
#define SDMMC_RESP_CRC (1lu << 12)
|
||||
// ! Card may send busy
|
||||
#define SDMMC_RESP_BUSY (1lu << 13)
|
||||
// Open drain for a braodcast command (bc)
|
||||
// Open drain for a broadcast command (bc)
|
||||
// or to enter in inactive state (MCI only)
|
||||
#define SDMMC_CMD_OPENDRAIN (1lu << 14)
|
||||
// ! To signal a data write operation
|
||||
#define SDMMC_CMD_WRITE (1lu << 15)
|
||||
// ! To signal a SDIO tranfer in multi byte mode
|
||||
// ! To signal a SDIO transfer in multi byte mode
|
||||
#define SDMMC_CMD_SDIO_BYTE (1lu << 16)
|
||||
// ! To signal a SDIO tranfer in block mode
|
||||
// ! To signal a SDIO transfer in block mode
|
||||
#define SDMMC_CMD_SDIO_BLOCK (1lu << 17)
|
||||
// ! To signal a data transfer in stream mode
|
||||
#define SDMMC_CMD_STREAM (1lu << 18)
|
||||
@ -132,7 +132,7 @@ typedef uint32_t sdmmc_cmd_def_t;
|
||||
#define SDMMC_CMD_MULTI_BLOCK (1lu << 20)
|
||||
// ! @}
|
||||
|
||||
// ! \name Set of flags to define a reponse type
|
||||
// ! \name Set of flags to define a response type
|
||||
// ! @{
|
||||
#define SDMMC_CMD_NO_RESP (0)
|
||||
#define SDMMC_CMD_R1 (SDMMC_RESP_PRESENT | SDMMC_RESP_CRC)
|
||||
@ -324,7 +324,7 @@ typedef uint32_t sdmmc_cmd_def_t;
|
||||
#define SD_MCI_ACMD41_SD_SEND_OP_COND (41 | SDMMC_CMD_R3 | SDMMC_CMD_OPENDRAIN)
|
||||
/**
|
||||
* ACMD41(R1): Send host capacity support information (HCS) and activates the
|
||||
* card's initilization process
|
||||
* card's initialization process
|
||||
*/
|
||||
#define SD_SPI_ACMD41_SD_SEND_OP_COND (41 | SDMMC_CMD_R1)
|
||||
/**
|
||||
@ -440,7 +440,7 @@ typedef uint32_t sdmmc_cmd_def_t;
|
||||
#define SDIO_R5_ERROR (1lu << 11) /**< General error */
|
||||
#define SDIO_R5_FUNC_NUM (1lu << 9) /**< Invalid function number */
|
||||
#define SDIO_R5_OUT_OF_RANGE (1lu << 8) /**< Argument out of range */
|
||||
#define SDIO_R5_STATUS_ERR (SDIO_R5_ERROR | SDIO_R5_FUNC_NUM | SDIO_R5_OUT_OF_RANGE) // !< Errro status bits mask
|
||||
#define SDIO_R5_STATUS_ERR (SDIO_R5_ERROR | SDIO_R5_FUNC_NUM | SDIO_R5_OUT_OF_RANGE) // !< Error status bits mask
|
||||
// ! @}
|
||||
|
||||
// ! \name SDIO state (in R6)
|
||||
|
@ -307,7 +307,7 @@ safe_mode_t port_init(void) {
|
||||
// because it was hard enough to figure out, and maybe there's
|
||||
// a mistake that could make it work in the future.
|
||||
#if 0
|
||||
// Designate QSPI memory mapped region as not cachable.
|
||||
// Designate QSPI memory mapped region as not cacheable.
|
||||
|
||||
// Turn off MPU in case it is on.
|
||||
MPU->CTRL = 0;
|
||||
@ -320,7 +320,7 @@ safe_mode_t port_init(void) {
|
||||
0b011 << MPU_RASR_AP_Pos | // full read/write access for privileged and user mode
|
||||
0b000 << MPU_RASR_TEX_Pos | // caching not allowed, strongly ordered
|
||||
1 << MPU_RASR_S_Pos | // sharable
|
||||
0 << MPU_RASR_C_Pos | // not cachable
|
||||
0 << MPU_RASR_C_Pos | // not cacheable
|
||||
0 << MPU_RASR_B_Pos | // not bufferable
|
||||
0b10111 << MPU_RASR_SIZE_Pos | // 16MB region size
|
||||
1 << MPU_RASR_ENABLE_Pos // enable this region
|
||||
|
@ -55,7 +55,7 @@ Connect these pins using a `USB adapter <https://www.adafruit.com/product/4090>`
|
||||
|
||||
**UART Connection:**
|
||||
|
||||
A `USB to UART convertor <https://www.adafruit.com/product/3309>`_ can be used for connecting to ESP32-C3 to get access to the serial console and REPL and for flashing CircuitPython.
|
||||
A `USB to UART converter <https://www.adafruit.com/product/3309>`_ can be used for connecting to ESP32-C3 to get access to the serial console and REPL and for flashing CircuitPython.
|
||||
|
||||
The following connections need to be made in this case:
|
||||
|
||||
@ -92,7 +92,7 @@ Connect these pins using a `USB adapter <https://www.adafruit.com/product/4090>`
|
||||
|
||||
**UART Connection:**
|
||||
|
||||
A `USB to UART convertor <https://www.adafruit.com/product/3309>`_ can be used for connecting to ESP32-S2 to get access to the serial console and REPL and for flashing CircuitPython.
|
||||
A `USB to UART converter <https://www.adafruit.com/product/3309>`_ can be used for connecting to ESP32-S2 to get access to the serial console and REPL and for flashing CircuitPython.
|
||||
|
||||
The following connections need to be made in this case:
|
||||
|
||||
@ -129,7 +129,7 @@ Connect these pins using a `USB adapter <https://www.adafruit.com/product/4090>`
|
||||
|
||||
**UART Connection:**
|
||||
|
||||
A `USB to UART convertor <https://www.adafruit.com/product/3309>`_ can be used for connecting to ESP32-S3 to get access to the serial console and REPL and for flashing CircuitPython.
|
||||
A `USB to UART converter <https://www.adafruit.com/product/3309>`_ can be used for connecting to ESP32-S3 to get access to the serial console and REPL and for flashing CircuitPython.
|
||||
|
||||
The following connections need to be made in this case:
|
||||
|
||||
|
@ -63,7 +63,7 @@
|
||||
//| """
|
||||
//| Configure and initialize a camera with the given properties
|
||||
//|
|
||||
//| This driver requires that the ``CIRCUITPY_RESERVED_PSRAM`` in ``settings.toml`` be large enough to hold the camera frambuffer(s). Generally, boards with built-in cameras will have a default setting that is large enough. If the constructor raises a MemoryError or an IDFError, this probably indicates the setting is too small and should be increased.
|
||||
//| This driver requires that the ``CIRCUITPY_RESERVED_PSRAM`` in ``settings.toml`` be large enough to hold the camera framebuffer(s). Generally, boards with built-in cameras will have a default setting that is large enough. If the constructor raises a MemoryError or an IDFError, this probably indicates the setting is too small and should be increased.
|
||||
//|
|
||||
//|
|
||||
//| .. important::
|
||||
@ -89,7 +89,7 @@
|
||||
//| :param reset_pin: The reset input to the camera module
|
||||
//| :param pixel_format: The pixel format of the captured image
|
||||
//| :param frame_size: The size of captured image
|
||||
//| :param jpeg_quality: For `PixelFormat.JPEG`, the quality. Higher numbers increase quality. If the quality is too high, the JPEG data will be larger than the availalble buffer size and the image will be unusable or truncated. The exact range of appropriate values depends on the sensor and must be determined empirically.
|
||||
//| :param jpeg_quality: For `PixelFormat.JPEG`, the quality. Higher numbers increase quality. If the quality is too high, the JPEG data will be larger than the available buffer size and the image will be unusable or truncated. The exact range of appropriate values depends on the sensor and must be determined empirically.
|
||||
//| :param framebuffer_count: The number of framebuffers (1 for single-buffered and 2 for double-buffered)
|
||||
//| :param grab_mode: When to grab a new frame
|
||||
//| """
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "common-hal/espnow/__init__.h"
|
||||
|
||||
// TODO: check peer already exist
|
||||
// TODO: check peer dosen't exist
|
||||
// TODO: check peer doesn't exist
|
||||
|
||||
//| class Peer:
|
||||
//| """A data class to store parameters specific to a peer."""
|
||||
|
@ -4,7 +4,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
|
||||
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
|
||||
|
||||
// S2 Mini Board bottom, right, top-bottom
|
||||
// GPIO0-GPIO14: broken out as a bloc on ESP32-S2FN4R2 SoC
|
||||
// GPIO0-GPIO14: broken out as a block on ESP32-S2FN4R2 SoC
|
||||
// mpconfigboard.h: GPIO0: CIRCUITPY_BOOT_BUTTON
|
||||
{ MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, // RTC_GPIO0,GPIO0
|
||||
@ -57,7 +57,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
|
||||
// skip GPIO22-GPIO25: not broken out on ESP32-S2FN4R2 SoC
|
||||
// skip GPIO26-GPIO32: SPI Flash & RAM, not broken out on S2 Mini (internal to ESP32-S2FN4R2 SoC?)
|
||||
|
||||
// GPIO33-GPIO40: broken out as a bloc on ESP32-S2FN4R2 SoC, last 2 half of JTAG
|
||||
// GPIO33-GPIO40: broken out as a block on ESP32-S2FN4R2 SoC, last 2 half of JTAG
|
||||
{ MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) },// SPIIO4,GPIO33,FSPIHD
|
||||
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO33) },// def from Wemos MP
|
||||
{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO33) },// D1 mini pin D2 GPIO4
|
||||
|
@ -193,7 +193,7 @@ static bool pmic_init(void) {
|
||||
}
|
||||
|
||||
// Reg: 12h
|
||||
// Enable EXTEN, DCDC1, LDO2 and LDO3
|
||||
// Enable CTRL_EXTEN, DCDC1, LDO2 and LDO3
|
||||
write_buf[0] = AXP192_DCDC13_LDO23_CTRL;
|
||||
write_buf[1] = AXP192_DCDC13_LDO23_CTRL_EXTEN |
|
||||
AXP192_DCDC13_LDO23_CTRL_LDO3 |
|
||||
|
@ -51,7 +51,7 @@ uint8_t display_init_sequence[] = {
|
||||
0xC5, 0x01, 0x0E, // _VMCTR1 VCOMH = 4V, VOML = -1.1V
|
||||
0x20, 0x00, // _INVOFF
|
||||
0x36, 0x01, 0x18, // _MADCTL bottom to top refresh
|
||||
// 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie,
|
||||
// 1 clk cycle nonoverlap, 2 cycle gate rise, 3 cycle osc equalie,
|
||||
// fix on VTL
|
||||
0x3A, 0x01, 0x05, // COLMOD - 16bit color
|
||||
0xE0, 0x10, 0x02, 0x1C, 0x07, 0x12, 0x37, 0x32, 0x29, 0x2D, 0x29, 0x25, 0x2B, 0x39, 0x00, 0x01, 0x03, 0x10, // _GMCTRP1 Gamma
|
||||
|
@ -221,7 +221,7 @@ mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t
|
||||
mp_float_t interval, mp_float_t window, mp_int_t minimum_rssi, bool active) {
|
||||
if (self->scan_results != NULL) {
|
||||
if (!shared_module_bleio_scanresults_get_done(self->scan_results)) {
|
||||
mp_raise_bleio_BluetoothError(translate("Scan already in progess. Stop with stop_scan."));
|
||||
mp_raise_bleio_BluetoothError(translate("Scan already in progress. Stop with stop_scan."));
|
||||
}
|
||||
self->scan_results = NULL;
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ STATIC int _discovered_characteristic_cb(uint16_t conn_handle,
|
||||
((chr->properties & BLE_GATT_CHR_PROP_WRITE) != 0 ? CHAR_PROP_WRITE : 0) |
|
||||
((chr->properties & BLE_GATT_CHR_PROP_WRITE_NO_RSP) != 0 ? CHAR_PROP_WRITE_NO_RESPONSE : 0);
|
||||
|
||||
// Call common_hal_bleio_characteristic_construct() to initalize some fields and set up evt handler.
|
||||
// Call common_hal_bleio_characteristic_construct() to initialize some fields and set up evt handler.
|
||||
common_hal_bleio_characteristic_construct(
|
||||
characteristic, service, chr->val_handle, uuid,
|
||||
props, SECURITY_MODE_OPEN, SECURITY_MODE_OPEN,
|
||||
|
@ -119,7 +119,7 @@ void alarm_touch_touchalarm_set_alarm(const bool deep_sleep, const size_t n_alar
|
||||
for (uint8_t i = 1; i <= 14; i++) {
|
||||
if ((touch_channel_mask & 1 << i) != 0) {
|
||||
touch_pad_t touch_channel = (touch_pad_t)i;
|
||||
// intialize touchpad
|
||||
// initialize touchpad
|
||||
peripherals_touch_init(touch_channel);
|
||||
|
||||
// wait for touch data to reset
|
||||
@ -166,7 +166,7 @@ void alarm_touch_touchalarm_prepare_for_deep_sleep(void) {
|
||||
peripherals_touch_never_reset(false);
|
||||
peripherals_touch_reset();
|
||||
|
||||
// intialize touchpad
|
||||
// initialize touchpad
|
||||
peripherals_touch_init(touch_channel);
|
||||
|
||||
#if !defined(CONFIG_IDF_TARGET_ESP32)
|
||||
|
@ -123,7 +123,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, const mcu
|
||||
rmt_config_t config = RMT_DEFAULT_CONFIG_RX(pin->number, channel);
|
||||
config.rx_config.filter_en = true;
|
||||
config.rx_config.idle_threshold = 30000; // 30*3=90ms idle required to register a sequence
|
||||
config.clk_div = 240; // All measurements are divided by 3 to accomodate 65ms pulses
|
||||
config.clk_div = 240; // All measurements are divided by 3 to accommodate 65ms pulses
|
||||
rmt_config(&config);
|
||||
rmt_driver_install(channel, 1000, 0); // TODO: pick a more specific buffer size?
|
||||
|
||||
|
@ -197,7 +197,7 @@ void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t *self) {
|
||||
if (!taken || self->variable_frequency) {
|
||||
ledc_timer_rst(LEDC_LOW_SPEED_MODE, self->tim_handle.timer_num);
|
||||
reserved_timer_freq[self->tim_handle.timer_num] = 0;
|
||||
// if timer isn't varfreq this will be off aleady
|
||||
// if timer isn't varfreq this will be off already
|
||||
varfreq_timers[self->tim_handle.timer_num] = false;
|
||||
never_reset_tim[self->tim_handle.timer_num] = false;
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencode
|
||||
.unit = unit,
|
||||
};
|
||||
|
||||
// Reinitalize same unit, CHANNEL_1 with different parameters.
|
||||
// Reinitialize same unit, CHANNEL_1 with different parameters.
|
||||
peripherals_pcnt_reinit(&pcnt_config_channel_1);
|
||||
|
||||
self->pin_a = pin_a->number;
|
||||
|
@ -44,7 +44,7 @@ typedef struct {
|
||||
} i2s_lcd_config_t;
|
||||
|
||||
/**
|
||||
* @brief Initilize i2s lcd driver.
|
||||
* @brief Initialize i2s lcd driver.
|
||||
*
|
||||
* @param config configuration of i2s
|
||||
*
|
||||
|
@ -93,7 +93,7 @@ SECTIONS
|
||||
|
||||
. = ALIGN(4);
|
||||
_etext = .; /* define a global symbol at end of code */
|
||||
_sidata = _etext; /* This is used by the startup in order to initialize the .data secion */
|
||||
_sidata = _etext; /* This is used by the startup in order to initialize the .data section */
|
||||
} >FLASH_FIRMWARE
|
||||
|
||||
/* Uninitialized data section */
|
||||
|
@ -72,7 +72,7 @@ static void ledda_init(void) {
|
||||
// Set clock register to 12 MHz / 64 kHz - 1
|
||||
ledda_write((12000000 / 64000) - 1, LEDDBR);
|
||||
|
||||
// Ensure LED "breathe" effect is diabled
|
||||
// Ensure LED "breathe" effect is disabled
|
||||
ledda_write(0, LEDDBCRR);
|
||||
ledda_write(0, LEDDBCFR);
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
_start:
|
||||
j crt_init
|
||||
# This sentinal ensures that this program is loaded
|
||||
# This sentinel ensures that this program is loaded
|
||||
# to RAM when loaded using dfu-util.
|
||||
#.word 0x17ab0f23
|
||||
#.word 0x10001000
|
||||
|
@ -64,7 +64,7 @@ void PLACE_IN_ITCM(common_hal_neopixel_write)(const digitalio_digitalinout_obj_t
|
||||
const uint32_t pin = digitalinout->pin->number;
|
||||
|
||||
__disable_irq();
|
||||
// Use DWT in debug core. Useable when interrupts disabled, as opposed to Systick->VAL
|
||||
// Use DWT in debug core. Usable when interrupts disabled, as opposed to Systick->VAL
|
||||
DWT->CYCCNT = 0;
|
||||
|
||||
for (;;) {
|
||||
|
@ -241,7 +241,7 @@ FLASHER ?=
|
||||
|
||||
ifeq ($(FLASHER),)
|
||||
|
||||
# Also update to bootloader settting to validate application and skip checksum ( app valid = 0x0001, crc = 0x0000 )
|
||||
# Also update to bootloader setting to validate application and skip checksum ( app valid = 0x0001, crc = 0x0000 )
|
||||
flash: $(BUILD)/firmware.hex
|
||||
nrfjprog --program $< --sectorerase -f $(MCU_VARIANT)
|
||||
nrfjprog --erasepage $(BOOT_SETTING_ADDR) -f $(MCU_VARIANT)
|
||||
|
@ -286,7 +286,7 @@ typedef struct
|
||||
/**@brief L2CAP event structure. */
|
||||
typedef struct
|
||||
{
|
||||
uint16_t conn_handle; /**< Connection Handle on which the event occured. */
|
||||
uint16_t conn_handle; /**< Connection Handle on which the event occurred. */
|
||||
uint16_t local_cid; /**< Local Channel ID of the L2CAP channel, or
|
||||
@ref BLE_L2CAP_CID_INVALID if not present. */
|
||||
union
|
||||
|
@ -287,7 +287,7 @@ typedef struct
|
||||
/**@brief L2CAP event structure. */
|
||||
typedef struct
|
||||
{
|
||||
uint16_t conn_handle; /**< Connection Handle on which the event occured. */
|
||||
uint16_t conn_handle; /**< Connection Handle on which the event occurred. */
|
||||
uint16_t local_cid; /**< Local Channel ID of the L2CAP channel, or
|
||||
@ref BLE_L2CAP_CID_INVALID if not present. */
|
||||
union
|
||||
|
@ -275,8 +275,8 @@ typedef struct
|
||||
* If the application returns from the fault handler the SoftDevice will call NVIC_SystemReset().
|
||||
*
|
||||
* @note It is recommended to either perform a reset in the fault handler or to let the SoftDevice reset the device.
|
||||
* Otherwise SoC peripherals may behave in an undefined way. For example, the RADIO peripherial may
|
||||
* continously transmit packets.
|
||||
* Otherwise SoC peripherals may behave in an undefined way. For example, the RADIO peripheral may
|
||||
* continuously transmit packets.
|
||||
*
|
||||
* @note This callback is executed in HardFault context, thus SVC functions cannot be called from the fault callback.
|
||||
*
|
||||
|
@ -48,7 +48,7 @@ extern "C" {
|
||||
/** @brief Supervisor call declaration.
|
||||
*
|
||||
* A call to a function marked with @ref SVCALL, will trigger a Supervisor Call (SVC) Exception.
|
||||
* The SVCs with SVC numbers 0x00-0x0F are forwared to the application. All other SVCs are handled by the SoftDevice.
|
||||
* The SVCs with SVC numbers 0x00-0x0F are forwarded to the application. All other SVCs are handled by the SoftDevice.
|
||||
*
|
||||
* @param[in] number The SVC number to be used.
|
||||
* @param[in] return_type The return type of the SVC function.
|
||||
|
@ -104,7 +104,7 @@ Parsing hex file.
|
||||
Erasing user available code and UICR flash areas.
|
||||
Applying system reset.
|
||||
Checking that the area to write is not protected.
|
||||
Programing device.
|
||||
Programming device.
|
||||
Applying system reset.
|
||||
Run.
|
||||
```
|
||||
|
@ -117,7 +117,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
|
||||
// { MP_ROM_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_P1_13) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_P1_13) },
|
||||
|
||||
// P28~P33/D28~D33 connecte into QSPI FlashROM (W25Q16JV_IQ)
|
||||
// P28~P33/D28~D33 connected into QSPI FlashROM (W25Q16JV_IQ)
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_P34), MP_ROM_PTR(&pin_P0_22) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_P0_22) },
|
||||
|
@ -8,11 +8,11 @@ We've also routed two I<sup>2</sup>C buses, 2 SPI buses, eleven GPIO, dedicated
|
||||
|
||||
## CircuitPython Pin Defs
|
||||
|
||||
CircuitPython pin definitions, while simialr to other boards represent a slight departure from just the typical `A` and `D` pin definitions. The majority of general pins are labled as `G` (or alternatively, `BUS`,) as the MicroMod system they build on uses those names to specify pins that may not be specficially analog or digital.
|
||||
CircuitPython pin definitions, while similar to other boards represent a slight departure from just the typical `A` and `D` pin definitions. The majority of general pins are labeled as `G` (or alternatively, `BUS`,) as the MicroMod system they build on uses those names to specify pins that may not be specficially analog or digital.
|
||||
|
||||
This can be somewhat confusing, especially around the analog pins. Here's a quick pin-map:
|
||||
|
||||
MicroMod Pin # | ATP Pin Label | Pin Definition | Additional Definitons | Pin/Port Reference | Notes
|
||||
MicroMod Pin # | ATP Pin Label | Pin Definition | Additional Definitions | Pin/Port Reference | Notes
|
||||
:--------------|:--------------|:--------------|:-----------------------|:-------------------|:------
|
||||
8 | G11 | | | (Not Connected) |
|
||||
10 | D0 | D0 | | P0_27 |
|
||||
|
@ -190,7 +190,7 @@ STATIC uint32_t ble_stack_enable(void) {
|
||||
return err_code;
|
||||
}
|
||||
|
||||
// Increase the GATT Server attribute size to accomodate both the CircuitPython built-in service
|
||||
// Increase the GATT Server attribute size to accommodate both the CircuitPython built-in service
|
||||
// and anything the user does.
|
||||
memset(&ble_conf, 0, sizeof(ble_conf));
|
||||
// Each increment to the BLE_GATTS_ATTR_TAB_SIZE_DEFAULT multiplier costs 1408 bytes.
|
||||
@ -529,7 +529,7 @@ STATIC bool scan_on_ble_evt(ble_evt_t *ble_evt, void *scan_results_in) {
|
||||
mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t *prefixes, size_t prefix_length, bool extended, mp_int_t buffer_size, mp_float_t timeout, mp_float_t interval, mp_float_t window, mp_int_t minimum_rssi, bool active) {
|
||||
if (self->scan_results != NULL) {
|
||||
if (!shared_module_bleio_scanresults_get_done(self->scan_results)) {
|
||||
mp_raise_bleio_BluetoothError(translate("Scan already in progess. Stop with stop_scan."));
|
||||
mp_raise_bleio_BluetoothError(translate("Scan already in progress. Stop with stop_scan."));
|
||||
}
|
||||
self->scan_results = NULL;
|
||||
}
|
||||
|
@ -283,7 +283,7 @@ void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self,
|
||||
}
|
||||
|
||||
// Write with response will return NRF_ERROR_BUSY if the response has not been received.
|
||||
// Write without reponse will return NRF_ERROR_RESOURCES if too many writes are pending.
|
||||
// Write without response will return NRF_ERROR_RESOURCES if too many writes are pending.
|
||||
if (err_code == NRF_ERROR_BUSY || err_code == NRF_ERROR_RESOURCES) {
|
||||
// We could wait for an event indicating the write is complete, but just retrying is easier.
|
||||
RUN_BACKGROUND_TASKS;
|
||||
|
@ -528,7 +528,7 @@ STATIC void on_char_discovery_rsp(ble_gattc_evt_char_disc_rsp_t *response, bleio
|
||||
(gattc_char->char_props.write ? CHAR_PROP_WRITE : 0) |
|
||||
(gattc_char->char_props.write_wo_resp ? CHAR_PROP_WRITE_NO_RESPONSE : 0);
|
||||
|
||||
// Call common_hal_bleio_characteristic_construct() to initalize some fields and set up evt handler.
|
||||
// Call common_hal_bleio_characteristic_construct() to initialize some fields and set up evt handler.
|
||||
common_hal_bleio_characteristic_construct(
|
||||
characteristic, m_char_discovery_service, gattc_char->handle_value, uuid,
|
||||
props, SECURITY_MODE_OPEN, SECURITY_MODE_OPEN,
|
||||
|
@ -249,7 +249,7 @@ void common_hal_bleio_gattc_write(uint16_t handle, uint16_t conn_handle, mp_buff
|
||||
}
|
||||
|
||||
// Write with response will return NRF_ERROR_BUSY if the response has not been received.
|
||||
// Write without reponse will return NRF_ERROR_RESOURCES if too many writes are pending.
|
||||
// Write without response will return NRF_ERROR_RESOURCES if too many writes are pending.
|
||||
if (err_code == NRF_ERROR_BUSY || err_code == NRF_ERROR_RESOURCES) {
|
||||
// We could wait for an event indicating the write is complete, but just retrying is easier.
|
||||
MICROPY_VM_HOOK_LOOP;
|
||||
|
@ -55,7 +55,7 @@ void common_hal_mcu_disable_interrupts() {
|
||||
// Unlike __disable_irq(), this should only be called the first time
|
||||
// "is_nested_critical_region" is sd's equivalent of our nesting count
|
||||
// so a nested call would store 0 in the global and make the later
|
||||
// exit call not actually reenable interrupts
|
||||
// exit call not actually re-enable interrupts
|
||||
//
|
||||
// This only disables interrupts of priority 2 through 7; levels 0, 1,
|
||||
// and 4, are exclusive to softdevice and should never be used, so
|
||||
|
@ -94,7 +94,7 @@ STATIC void reset_single_pwmout(uint8_t i) {
|
||||
|
||||
for (int ch = 0; ch < CHANNELS_PER_PWM; ch++) {
|
||||
pwm_seq[i][ch] = (1 << 15); // polarity = 0
|
||||
pwm->PSEL.OUT[ch] = 0xFFFFFFFF; // disconnnect from I/O
|
||||
pwm->PSEL.OUT[ch] = 0xFFFFFFFF; // disconnect from I/O
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@
|
||||
// This also includes mpconfigboard.h.
|
||||
#include "py/circuitpy_mpconfig.h"
|
||||
|
||||
// Definitions that might be overriden by mpconfigboard.h
|
||||
// Definitions that might be overridden by mpconfigboard.h
|
||||
|
||||
#ifndef CIRCUITPY_INTERNAL_NVM_SIZE
|
||||
#define CIRCUITPY_INTERNAL_NVM_SIZE (8 * 1024)
|
||||
|
@ -59,7 +59,7 @@ static int sck_delay_saved = 0;
|
||||
void qspi_disable(void) {
|
||||
// If VBUS is detected, no need to disable QSPI
|
||||
if (NRF_QSPI->ENABLE && !(NRF_POWER->USBREGSTATUS & POWER_USBREGSTATUS_VBUSDETECT_Msk)) {
|
||||
// Keep CS high when QSPI is diabled
|
||||
// Keep CS high when QSPI is disabled
|
||||
nrf_gpio_cfg_output(MICROPY_QSPI_CS);
|
||||
nrf_gpio_pin_write(MICROPY_QSPI_CS, 1);
|
||||
|
||||
|
@ -84,7 +84,7 @@ const mp_obj_type_t cyw43_pin_type = {
|
||||
//| The low 4 bits, ``m``, are the power management mode:
|
||||
//| * 0: disabled
|
||||
//| * 1: aggressive power saving which reduces wifi throughput
|
||||
//| * 2: Power saving with high througput
|
||||
//| * 2: Power saving with high throughput
|
||||
//|
|
||||
//| The next 8 bits, ``r``, specify "the maximum time to wait before going back to sleep" for power management mode 2. The units of ``r`` are 10ms.
|
||||
//|
|
||||
|
@ -257,7 +257,7 @@ mp_uint_t common_hal_ssl_sslsocket_recv_into(ssl_sslsocket_obj_t *self, uint8_t
|
||||
} else if (ret == MBEDTLS_ERR_SSL_WANT_WRITE) {
|
||||
// If handshake is not finished, read attempt may end up in protocol
|
||||
// wanting to write next handshake message. The same may happen with
|
||||
// renegotation.
|
||||
// renegotiation.
|
||||
ret = MP_EWOULDBLOCK;
|
||||
}
|
||||
DEBUG("raising errno [error case] %d\n", ret);
|
||||
@ -276,7 +276,7 @@ mp_uint_t common_hal_ssl_sslsocket_send(ssl_sslsocket_obj_t *self, const uint8_t
|
||||
} else if (ret == MBEDTLS_ERR_SSL_WANT_READ) {
|
||||
// If handshake is not finished, write attempt may end up in protocol
|
||||
// wanting to read next handshake message. The same may happen with
|
||||
// renegotation.
|
||||
// renegotiation.
|
||||
ret = MP_EWOULDBLOCK;
|
||||
}
|
||||
DEBUG("raising errno [error case] %d\n", ret);
|
||||
|
@ -176,7 +176,7 @@ void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_
|
||||
|
||||
common_hal_wifi_radio_stop_ap(self);
|
||||
|
||||
// Channel can only be changed after inital powerup and config of ap.
|
||||
// Channel can only be changed after initial powerup and config of ap.
|
||||
// Defaults to 1 if not set or invalid (i.e. 13)
|
||||
cyw43_wifi_ap_set_channel(&cyw43_state, (const uint32_t)channel);
|
||||
|
||||
|
@ -107,7 +107,7 @@ void raise_cyw_error(int err) {
|
||||
mp_errno = MP_ETIMEDOUT;
|
||||
break;
|
||||
default:
|
||||
mp_raise_OSError_msg_varg(translate("Unkown error code %d"), err);
|
||||
mp_raise_OSError_msg_varg(translate("Unknown error code %d"), err);
|
||||
}
|
||||
mp_raise_OSError(mp_errno);
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ CIRCUITPY_ROTARYIO ?= 1
|
||||
CIRCUITPY_ROTARYIO_SOFTENCODER = 1
|
||||
|
||||
# Things that need to be implemented.
|
||||
# Use PWM interally
|
||||
# Use PWM internally
|
||||
CIRCUITPY_FREQUENCYIO = 0
|
||||
CIRCUITPY_I2CTARGET = 1
|
||||
CIRCUITPY_NVM = 1
|
||||
# Use PIO interally
|
||||
# Use PIO internally
|
||||
CIRCUITPY_PULSEIO ?= 1
|
||||
CIRCUITPY_WATCHDOG ?= 1
|
||||
|
||||
|
@ -24,7 +24,7 @@ SECTIONS
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.isr_vector)) /* Startup code */
|
||||
|
||||
/* This first flash block is 16K annd the isr vectors only take up
|
||||
/* This first flash block is 16K and the isr vectors only take up
|
||||
about 400 bytes. Micropython pads this with files, but this didn't
|
||||
work with the size of Circuitpython's ff object. */
|
||||
|
||||
|
@ -26,7 +26,7 @@ SECTIONS
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.isr_vector)) /* Startup code */
|
||||
|
||||
/* This first flash block is 16K annd the isr vectors only take up
|
||||
/* This first flash block is 16K and the isr vectors only take up
|
||||
about 400 bytes. Micropython pads this with files, but this didn't
|
||||
work with the size of Circuitpython's ff object. */
|
||||
|
||||
|
@ -26,7 +26,7 @@ SECTIONS
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.isr_vector)) /* Startup code */
|
||||
|
||||
/* This first flash block is 16K annd the isr vectors only take up
|
||||
/* This first flash block is 16K and the isr vectors only take up
|
||||
about 400 bytes. Micropython pads this with files, but this didn't
|
||||
work with the size of Circuitpython's ff object. */
|
||||
|
||||
|
@ -14,7 +14,7 @@ LD_COMMON = boards/common_default.ld
|
||||
LD_FILE = boards/STM32F401xd_fs.ld
|
||||
|
||||
# Disable ulab as we're nearly out of space on this board due to
|
||||
# INTERNAL_FLASH_FILESYSTEM. It can probably be reenabled if we enable
|
||||
# INTERNAL_FLASH_FILESYSTEM. It can probably be re-enabled if we enable
|
||||
# lto for this port, and if other stuff hasn't been added in the
|
||||
# meantime
|
||||
CIRCUITPY_AESIO = 0
|
||||
|
@ -54,7 +54,7 @@ uint8_t display_init_sequence[] = {
|
||||
0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V
|
||||
0x20, 0, // _INVOFF //MISMATCh 0x2a vs 0x20
|
||||
0x36, 1, 0x60, // _MADCTL bottom to top refresh
|
||||
// 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie,
|
||||
// 1 clk cycle nonoverlap, 2 cycle gate rise, 3 cycle osc equalie,
|
||||
// fix on VTL
|
||||
0x3a, 1, 0x05, // COLMOD - 16bit color
|
||||
0xe0, 0x10, 0x02, 0x1c, 0x07, 0x12,
|
||||
|
@ -5,7 +5,7 @@ import digitalio
|
||||
import supervisor
|
||||
import time
|
||||
|
||||
# Scenario: Enable 3V3 pin defintiion
|
||||
# Scenario: Enable 3V3 pin definition
|
||||
# Then the symbol "board.ENABLE_3V3" is defined
|
||||
assert board.ENABLE_3V3 is not None
|
||||
|
||||
|
@ -35,7 +35,7 @@ extern "C" {
|
||||
|
||||
/**
|
||||
* @brief How many milliseconds of audio can fit in the audio buffer(s).
|
||||
* Interrupts for recieved data fire at half this duration / twice the frequency.
|
||||
* Interrupts for received data fire at half this duration / twice the frequency.
|
||||
*/
|
||||
#ifndef MEMS_AUDIO_MS_BUFFER
|
||||
#define MEMS_AUDIO_MS_BUFFER (1)
|
||||
|
@ -148,7 +148,7 @@ typedef struct MemsAudio_STM32L4SAIPDM_t {
|
||||
pdm_data_available_t pdm_data_available;
|
||||
|
||||
/**
|
||||
* @brief A cound of the number of PDM clients in use.
|
||||
* @brief A count of the number of PDM clients in use.
|
||||
*/
|
||||
uint32_t SAI1_client;
|
||||
|
||||
|
@ -67,7 +67,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t *digitalinout,
|
||||
uint32_t p_mask = pin_mask(digitalinout->pin->number);
|
||||
|
||||
__disable_irq();
|
||||
// Enable DWT in debug core. Useable when interrupts disabled, as opposed to Systick->VAL
|
||||
// Enable DWT in debug core. Usable when interrupts disabled, as opposed to Systick->VAL
|
||||
CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
|
||||
DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk;
|
||||
DWT->CYCCNT = 0;
|
||||
|
@ -456,7 +456,7 @@ STATIC mp_obj_t extra_coverage(void) {
|
||||
{
|
||||
mp_printf(&mp_plat_print, "# VM\n");
|
||||
|
||||
// call mp_execute_bytecode with invalide bytecode (should raise NotImplementedError)
|
||||
// call mp_execute_bytecode with invalid bytecode (should raise NotImplementedError)
|
||||
mp_obj_fun_bc_t fun_bc;
|
||||
fun_bc.bytecode = (const byte *)"\x01"; // just needed for n_state
|
||||
mp_code_state_t *code_state = m_new_obj_var(mp_code_state_t, mp_obj_t, 1);
|
||||
|
@ -147,7 +147,7 @@ STATIC mp_obj_t mod_os_remove(mp_obj_t path_in) {
|
||||
const char *path = mp_obj_str_get_str(path_in);
|
||||
|
||||
// Note that POSIX requires remove() to be able to delete a directory
|
||||
// too (act as rmdir()). This is POSIX extenstion to ANSI C semantics
|
||||
// too (act as rmdir()). This is POSIX extension to ANSI C semantics
|
||||
// of that function. But Python remove() follows ANSI C, and explicitly
|
||||
// required to raise exception on attempt to remove a directory. Thus,
|
||||
// call POSIX unlink() here.
|
||||
|
@ -73,7 +73,7 @@ STATIC mp_obj_t mod_termios_tcsetattr(mp_obj_t fd_in, mp_obj_t when_in, mp_obj_t
|
||||
// We don't export TCSANOW and friends to save on code space. Then
|
||||
// common lazy sense says that passing 0 should be godo enough, and
|
||||
// it is e.g. for glibc. But for other libc's it's not, so set just
|
||||
// treat 0 as defauling to TCSANOW.
|
||||
// treat 0 as defaulting to TCSANOW.
|
||||
when = TCSANOW;
|
||||
}
|
||||
|
||||
|
@ -281,7 +281,7 @@ bool asm_thumb_b_n_label(asm_thumb_t *as, uint label) {
|
||||
|
||||
#define OP_BCC_N(cond, byte_offset) (0xd000 | ((cond) << 8) | (((byte_offset) >> 1) & 0x00ff))
|
||||
|
||||
// all these bit arithmetics need coverage testing!
|
||||
// all these bit arithmetic need coverage testing!
|
||||
#define OP_BCC_W_HI(cond, byte_offset) (0xf000 | ((cond) << 6) | (((byte_offset) >> 10) & 0x0400) | (((byte_offset) >> 14) & 0x003f))
|
||||
#define OP_BCC_W_LO(byte_offset) (0x8000 | ((byte_offset) & 0x2000) | (((byte_offset) >> 1) & 0x0fff))
|
||||
|
||||
|
@ -393,7 +393,7 @@ extern const struct _mp_obj_module_t nvm_module;
|
||||
// Native modules that are weak links can be accessed directly
|
||||
// by prepending their name with an underscore. This list should correspond to
|
||||
// MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS, assuming you want the native modules
|
||||
// to be accessible when overriden.
|
||||
// to be accessible when overridden.
|
||||
|
||||
#define MICROPY_PORT_BUILTIN_MODULE_ALT_NAMES
|
||||
|
||||
|
@ -526,7 +526,7 @@ CFLAGS += -DUSB_NUM_ENDPOINT_PAIRS=$(USB_NUM_ENDPOINT_PAIRS)
|
||||
CIRCUITPY_USTACK ?= 0
|
||||
CFLAGS += -DCIRCUITPY_USTACK=$(CIRCUITPY_USTACK)
|
||||
|
||||
# for decompressing utlities
|
||||
# for decompressing utilities
|
||||
CIRCUITPY_ZLIB ?= $(CIRCUITPY_FULL_BUILD)
|
||||
CFLAGS += -DCIRCUITPY_ZLIB=$(CIRCUITPY_ZLIB)
|
||||
|
||||
|
@ -3477,7 +3477,7 @@ mp_raw_code_t *mp_compile_to_raw_code(mp_parse_tree_t *parse_tree, qstr source_f
|
||||
}
|
||||
}
|
||||
|
||||
// update maximim number of labels needed
|
||||
// update maximum number of labels needed
|
||||
if (comp->next_label > max_num_labels) {
|
||||
max_num_labels = comp->next_label;
|
||||
}
|
||||
|
@ -253,7 +253,7 @@ STATIC void emit_write_bytecode_byte_obj(emit_t *emit, int stack_adj, byte b, mp
|
||||
emit_write_bytecode_byte(emit, stack_adj, b);
|
||||
emit->bytecode_offset = (size_t)MP_ALIGN(emit->bytecode_offset, sizeof(mp_obj_t));
|
||||
mp_obj_t *c = (mp_obj_t *)emit_get_cur_to_write_bytecode(emit, sizeof(mp_obj_t));
|
||||
// Verify thar c is already uint-aligned
|
||||
// Verify that c is already uint-aligned
|
||||
assert(c == MP_ALIGN(c, sizeof(mp_obj_t)));
|
||||
*c = obj;
|
||||
#endif
|
||||
@ -269,7 +269,7 @@ STATIC void emit_write_bytecode_byte_raw_code(emit_t *emit, int stack_adj, byte
|
||||
emit_write_bytecode_byte(emit, stack_adj, b);
|
||||
emit->bytecode_offset = (size_t)MP_ALIGN(emit->bytecode_offset, sizeof(void *));
|
||||
void **c = (void **)emit_get_cur_to_write_bytecode(emit, sizeof(void *));
|
||||
// Verify thar c is already uint-aligned
|
||||
// Verify that c is already uint-aligned
|
||||
assert(c == MP_ALIGN(c, sizeof(void *)));
|
||||
*c = rc;
|
||||
#endif
|
||||
|
@ -944,7 +944,7 @@ STATIC void emit_access_stack(emit_t *emit, int pos, vtype_kind_t *vtype, int re
|
||||
}
|
||||
|
||||
// does an efficient X=pop(); discard(); push(X)
|
||||
// needs a (non-temp) register in case the poped element was stored in the stack
|
||||
// needs a (non-temp) register in case the popped element was stored in the stack
|
||||
STATIC void emit_fold_stack_top(emit_t *emit, int reg_dest) {
|
||||
stack_info_t *si = &emit->stack_info[emit->stack_size - 2];
|
||||
si[0] = si[1];
|
||||
|
@ -39,7 +39,7 @@
|
||||
Routine for converting a arbitrary floating
|
||||
point number into a string.
|
||||
|
||||
The code in this funcion was inspired from Fred Bayer's pdouble.c.
|
||||
The code in this function was inspired from Fred Bayer's pdouble.c.
|
||||
Since pdouble.c was released as Public Domain, I'm releasing this
|
||||
code as public domain as well.
|
||||
|
||||
@ -390,7 +390,7 @@ int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, ch
|
||||
--dec;
|
||||
--num_digits_left;
|
||||
if (digit_index <= 0) {
|
||||
// Once we get below 1.0, we scale up f instead of calculting
|
||||
// Once we get below 1.0, we scale up f instead of calculating
|
||||
// negative powers of 10 in u_base. This provides better
|
||||
// renditions of exact decimals like 1/16 etc.
|
||||
f *= FPCONST(10.0);
|
||||
|
@ -24,7 +24,7 @@ def check_non_ascii(msg):
|
||||
|
||||
|
||||
# Replace <char><space> with <char | 0x80>.
|
||||
# Trival scheme to demo/test.
|
||||
# Trivial scheme to demo/test.
|
||||
def space_compression(error_strings):
|
||||
for line in error_strings:
|
||||
check_non_ascii(line)
|
||||
|
@ -13,7 +13,7 @@ OBJ_EXTRA_ORDER_DEPS =
|
||||
# tree.
|
||||
#
|
||||
# So for example, py/map.c would have an object file name py/map.o
|
||||
# The object files will go into the build directory and mantain the same
|
||||
# The object files will go into the build directory and maintain the same
|
||||
# directory structure as the source tree. So the final dependency will look
|
||||
# like this:
|
||||
#
|
||||
@ -142,7 +142,7 @@ endif
|
||||
ifneq ($(PROG),)
|
||||
# Build a standalone executable (unix does this)
|
||||
|
||||
# The executable should have an .exe extension for builds targetting 'pure'
|
||||
# The executable should have an .exe extension for builds targeting 'pure'
|
||||
# Windows, i.e. msvc or mingw builds, but not when using msys or cygwin's gcc.
|
||||
COMPILER_TARGET := $(shell $(CC) -dumpmachine)
|
||||
ifneq (,$(findstring mingw,$(COMPILER_TARGET)))
|
||||
|
@ -176,7 +176,7 @@ mp_obj_t mp_obj_exception_make_new(const mp_obj_type_t *type, size_t n_args, siz
|
||||
|
||||
mp_obj_tuple_t *o_tuple;
|
||||
if (n_args == 0) {
|
||||
// No args, can use the empty tuple straightaway
|
||||
// No args, can use the empty tuple straight away
|
||||
o_tuple = (mp_obj_tuple_t *)&mp_const_empty_tuple_obj;
|
||||
} else {
|
||||
// Try to allocate memory for the tuple containing the args
|
||||
|
@ -649,7 +649,7 @@ STATIC void mp_obj_instance_load_attr(mp_obj_t self_in, qstr attr, mp_obj_t *des
|
||||
mp_obj_t member = dest[0];
|
||||
if (member != MP_OBJ_NULL) {
|
||||
if (!(self->base.type->flags & MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS)) {
|
||||
// Class doesn't have any special accessors to check so return straightaway
|
||||
// Class doesn't have any special accessors to check so return straight away
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -414,7 +414,7 @@ mp_obj_t MICROPY_WRAP_MP_BINARY_OP(mp_binary_op)(mp_binary_op_t op, mp_obj_t lhs
|
||||
} else {
|
||||
// standard precision is enough for right-shift
|
||||
if (rhs_val >= (mp_int_t)(sizeof(lhs_val) * MP_BITS_PER_BYTE)) {
|
||||
// Shifting to big amounts is underfined behavior
|
||||
// Shifting to big amounts is undefined behavior
|
||||
// in C and is CPU-dependent; propagate sign bit.
|
||||
rhs_val = sizeof(lhs_val) * MP_BITS_PER_BYTE - 1;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ typedef struct _id_info_t {
|
||||
uint8_t kind;
|
||||
uint8_t flags;
|
||||
// when it's an ID_INFO_KIND_LOCAL this is the unique number of the local
|
||||
// whet it's an ID_INFO_KIND_CELL/FREE this is the unique number of the closed over variable
|
||||
// when it's an ID_INFO_KIND_CELL/FREE this is the unique number of the closed over variable
|
||||
uint16_t local_num;
|
||||
qstr qst;
|
||||
} id_info_t;
|
||||
|
@ -171,7 +171,7 @@ bool mp_seq_cmp_objs(mp_uint_t op, const mp_obj_t *items1, size_t len1, const mp
|
||||
continue;
|
||||
}
|
||||
|
||||
// Othewise, if they are not equal, we can have final decision based on them
|
||||
// Otherwise, if they are not equal, we can have final decision based on them
|
||||
if (op == MP_BINARY_OP_EQUAL) {
|
||||
// In particular, if we are checking for equality, here're the answer
|
||||
return false;
|
||||
|
@ -71,7 +71,7 @@
|
||||
|
||||
//| wake_alarm: Optional[circuitpython_typing.Alarm]
|
||||
//| """The most recently triggered alarm. If CircuitPython was sleeping, the alarm that woke it from sleep.
|
||||
//| If no alarm occured since the last hard reset or soft restart, value is ``None``.
|
||||
//| If no alarm occurred since the last hard reset or soft restart, value is ``None``.
|
||||
//| """
|
||||
//|
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "common-hal/digitalio/DigitalInOut.h"
|
||||
|
||||
// Light sleep fully self-contained and does not exit user code. It will return
|
||||
// the same alarm object that was orignally passed in, unlike deep sleep, which
|
||||
// the same alarm object that was originally passed in, unlike deep sleep, which
|
||||
// must create an identical copy due to the VM reset
|
||||
extern mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const mp_obj_t *alarms);
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
//| """Support for MP3-compressed audio files
|
||||
//|
|
||||
//| For more infomration about working with MP3 files in CircuitPython,
|
||||
//| For more information about working with MP3 files in CircuitPython,
|
||||
//| see `this CircuitPython Essentials Learn guide page
|
||||
//| <https://learn.adafruit.com/circuitpython-essentials/circuitpython-mp3-audio>`_.
|
||||
//| """
|
||||
|
@ -530,14 +530,14 @@ MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_draw_line_obj, 0, bitmaptools_obj_draw_li
|
||||
//| value: int,
|
||||
//| close: Optional[bool] = True,
|
||||
//| ) -> None:
|
||||
//| """Draw a polygon conecting points on provided bitmap with provided value
|
||||
//| """Draw a polygon connecting points on provided bitmap with provided value
|
||||
//|
|
||||
//| :param bitmap dest_bitmap: Destination bitmap that will be written into
|
||||
//| :param ReadableBuffer xs: x-pixel position of the polygon's vertices
|
||||
//| :param ReadableBuffer ys: y-pixel position of the polygon's vertices
|
||||
//| :param int value: Bitmap palette index that will be written into the
|
||||
//| line in the destination bitmap
|
||||
//| :param bool close: (Optional) Wether to connect first and last point. (True)
|
||||
//| :param bool close: (Optional) Whether to connect first and last point. (True)
|
||||
//|
|
||||
//| .. code-block:: Python
|
||||
//|
|
||||
@ -630,7 +630,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_draw_polygon_obj, 0, bitmaptools_obj_draw
|
||||
//| """Inserts pixels from ``data`` into the rectangle of width×height pixels with the upper left corner at ``(x,y)``
|
||||
//|
|
||||
//| The values from ``data`` are taken modulo the number of color values
|
||||
//| avalable in the destination bitmap.
|
||||
//| available in the destination bitmap.
|
||||
//|
|
||||
//| If x1 or y1 are not specified, they are taken as 0. If x2 or y2
|
||||
//| are not specified, or are given as -1, they are taken as the width
|
||||
@ -722,7 +722,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_arrayblit_obj, 0, bitmaptools_arrayblit);
|
||||
//| :param typing.BinaryIO file: A file opened in binary mode
|
||||
//| :param int bits_per_pixel: Number of bits per pixel. Values 1, 2, 4, 8, 16, 24, and 32 are supported;
|
||||
//| :param int element_size: Number of bytes per element. Values of 1, 2, and 4 are supported, except that 24 ``bits_per_pixel`` requires 1 byte per element.
|
||||
//| :param bool reverse_pixels_in_element: If set, the first pixel in a word is taken from the Most Signficant Bits; otherwise, it is taken from the Least Significant Bits.
|
||||
//| :param bool reverse_pixels_in_element: If set, the first pixel in a word is taken from the Most Significant Bits; otherwise, it is taken from the Least Significant Bits.
|
||||
//| :param bool swap_bytes_in_element: If the ``element_size`` is not 1, then reverse the byte order of each element read.
|
||||
//| :param bool reverse_rows: Reverse the direction of the row loading (required for some bitmap images).
|
||||
//| """
|
||||
@ -782,7 +782,7 @@ STATIC mp_obj_t bitmaptools_readinto(size_t n_args, const mp_obj_t *pos_args, mp
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_readinto_obj, 0, bitmaptools_readinto);
|
||||
|
||||
//| class DitherAlgorithm:
|
||||
//| """Identifies the algorith for dither to use"""
|
||||
//| """Identifies the algorithm for dither to use"""
|
||||
//|
|
||||
//| Atkinson: "DitherAlgorithm"
|
||||
//| """The classic Atkinson dither, often associated with the Hypercard esthetic"""
|
||||
|
@ -43,7 +43,7 @@
|
||||
//| Common container for board base pin names. These will vary from board to
|
||||
//| board so don't expect portability when using this module.
|
||||
//|
|
||||
//| Another common use of this module is to use serial communciation buses with
|
||||
//| Another common use of this module is to use serial communication buses with
|
||||
//| the default pins and settings. For more information about serial communcication
|
||||
//| in CircuitPython, see the :mod:`busio`.
|
||||
//|
|
||||
|
@ -157,7 +157,7 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, si
|
||||
|
||||
// Always initially allocate the UART object within the long-lived heap.
|
||||
// This is needed to avoid crashes with certain UART implementations which
|
||||
// cannot accomodate being moved after creation. (See
|
||||
// cannot accommodate being moved after creation. (See
|
||||
// https://github.com/adafruit/circuitpython/issues/1056)
|
||||
busio_uart_obj_t *self = m_new_ll_obj_with_finaliser(busio_uart_obj_t);
|
||||
self->base.type = &busio_uart_type;
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
//| """Support for edge counting
|
||||
//|
|
||||
//| The `countio` module contains logic to read and count edge transistions
|
||||
//| The `countio` module contains logic to read and count edge transitions
|
||||
//|
|
||||
//| For more information on the applications of counting edges, see
|
||||
//| `this Learn Guide on sequential circuits
|
||||
|
@ -61,7 +61,7 @@
|
||||
//|
|
||||
|
||||
//| def release_displays() -> None:
|
||||
//| """Releases any actively used displays so their busses and pins can be used again. This will also
|
||||
//| """Releases any actively used displays so their buses and pins can be used again. This will also
|
||||
//| release the builtin display on boards that have one. You will need to reinitialize it yourself
|
||||
//| afterwards. This may take seconds to complete if an active EPaperDisplay is refreshing.
|
||||
//|
|
||||
|
@ -64,7 +64,7 @@ STATIC mp_obj_t keypad_event_make_new(const mp_obj_type_t *type, size_t n_args,
|
||||
timestamp = supervisor_ticks_ms();
|
||||
}
|
||||
|
||||
(void)mp_obj_get_int_truncated(timestamp); // ensure that timesamp is an integer
|
||||
(void)mp_obj_get_int_truncated(timestamp); // ensure that timestamp is an integer
|
||||
common_hal_keypad_event_construct(self, key_number, args[ARG_pressed].u_bool, timestamp);
|
||||
return MP_OBJ_FROM_PTR(self);
|
||||
}
|
||||
|
@ -56,7 +56,7 @@
|
||||
//| An `EventQueue` is created when this object is created and is available in the `events` attribute.
|
||||
//|
|
||||
//| :param Sequence[microcontroller.Pin] row_pins: The pins attached to the rows.
|
||||
//| :param Sequence[microcontroller.Pin] column_pins: The pins attached to the colums.
|
||||
//| :param Sequence[microcontroller.Pin] column_pins: The pins attached to the columns.
|
||||
//| :param bool columns_to_anodes: Default ``True``.
|
||||
//| If the matrix uses diodes, the diode anodes are typically connected to the column pins,
|
||||
//| and the cathodes should be connected to the row pins. If your diodes are reversed,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user