diff --git a/.github/ISSUE_TEMPLATE/security.md b/.github/ISSUE_TEMPLATE/security.md index 2bbfede6ce..cfe4a4befd 100644 --- a/.github/ISSUE_TEMPLATE/security.md +++ b/.github/ISSUE_TEMPLATE/security.md @@ -1,6 +1,6 @@ --- name: Security report -about: Report a security issue or vunerability in MicroPython +about: Report a security issue or vulnerability in MicroPython title: '' labels: security assignees: '' diff --git a/CODECONVENTIONS.md b/CODECONVENTIONS.md index 3b678bfeb8..6ab3324c2e 100644 --- a/CODECONVENTIONS.md +++ b/CODECONVENTIONS.md @@ -255,7 +255,7 @@ Documentation conventions ========================= MicroPython generally follows CPython in documentation process and -conventions. reStructuredText syntax is used for the documention. +conventions. reStructuredText syntax is used for the documentation. Specific conventions/suggestions: diff --git a/docs/develop/cmodules.rst b/docs/develop/cmodules.rst index 6bc2f62ab4..75dbc953c0 100644 --- a/docs/develop/cmodules.rst +++ b/docs/develop/cmodules.rst @@ -53,7 +53,7 @@ A MicroPython user C module is a directory with the following files: ``SRC_USERMOD_C`` or ``SRC_USERMOD_LIB_C`` variables. The former will be processed for ``MP_QSTR_`` and ``MP_REGISTER_MODULE`` definitions, the latter will not (e.g. helpers and library code that isn't MicroPython-specific). - These paths should include your expaned copy of ``$(USERMOD_DIR)``, e.g.:: + These paths should include your expanded copy of ``$(USERMOD_DIR)``, e.g.:: SRC_USERMOD_C += $(EXAMPLE_MOD_DIR)/modexample.c SRC_USERMOD_LIB_C += $(EXAMPLE_MOD_DIR)/utils/algorithm.c diff --git a/docs/esp32/tutorial/intro.rst b/docs/esp32/tutorial/intro.rst index 8ed42dbd3d..be09599871 100644 --- a/docs/esp32/tutorial/intro.rst +++ b/docs/esp32/tutorial/intro.rst @@ -17,7 +17,7 @@ Requirements The first thing you need is a board with an ESP32 chip. The MicroPython software supports the ESP32 chip itself and any board should work. The main characteristic of a board is how the GPIO pins are connected to the outside -world, and whether it includes a built-in USB-serial convertor to make the +world, and whether it includes a built-in USB-serial converter to make the UART available to your PC. Names of pins will be given in this tutorial using the chip names (eg GPIO2) @@ -59,7 +59,7 @@ bootloader mode, and second you need to copy across the firmware. The exact procedure for these steps is highly dependent on the particular board and you will need to refer to its documentation for details. -Fortunately, most boards have a USB connector, a USB-serial convertor, and the DTR +Fortunately, most boards have a USB connector, a USB-serial converter, and the DTR and RTS pins wired in a special way then deploying the firmware should be easy as all steps can be done automatically. Boards that have such features include the Adafruit Feather HUZZAH32, M5Stack, Wemos LOLIN32, and TinyPICO @@ -104,7 +104,7 @@ Serial prompt Once you have the firmware on the device you can access the REPL (Python prompt) over UART0 (GPIO1=TX, GPIO3=RX), which might be connected to a USB-serial -convertor, depending on your board. The baudrate is 115200. +converter, depending on your board. The baudrate is 115200. From here you can now follow the ESP8266 tutorial, because these two Espressif chips are very similar when it comes to using MicroPython on them. The ESP8266 tutorial @@ -124,7 +124,7 @@ after it, here are troubleshooting recommendations: * The flashing instructions above use flashing speed of 460800 baud, which is good compromise between speed and stability. However, depending on your - module/board, USB-UART convertor, cables, host OS, etc., the above baud + module/board, USB-UART converter, cables, host OS, etc., the above baud rate may be too high and lead to errors. Try a more common 115200 baud rate instead in such cases. diff --git a/docs/esp8266/tutorial/intro.rst b/docs/esp8266/tutorial/intro.rst index 75739bd6f9..0d4bc42e2d 100644 --- a/docs/esp8266/tutorial/intro.rst +++ b/docs/esp8266/tutorial/intro.rst @@ -18,7 +18,7 @@ The first thing you need is a board with an ESP8266 chip. The MicroPython software supports the ESP8266 chip itself and any board should work. The main characteristic of a board is how much flash it has, how the GPIO pins are connected to the outside world, and whether it includes a built-in USB-serial -convertor to make the UART available to your PC. +converter to make the UART available to your PC. The minimum requirement for flash size is 1Mbyte. There is also a special build for boards with 512KB, but it is highly limited comparing to the @@ -70,7 +70,7 @@ need to put your device in boot-loader mode, and second you need to copy across the firmware. The exact procedure for these steps is highly dependent on the particular board and you will need to refer to its documentation for details. -If you have a board that has a USB connector, a USB-serial convertor, and has +If you have a board that has a USB connector, a USB-serial converter, and has the DTR and RTS pins wired in a special way then deploying the firmware should be easy as all steps can be done automatically. Boards that have such features include the Adafruit Feather HUZZAH and NodeMCU boards. @@ -128,7 +128,7 @@ Serial prompt Once you have the firmware on the device you can access the REPL (Python prompt) over UART0 (GPIO1=TX, GPIO3=RX), which might be connected to a USB-serial -convertor, depending on your board. The baudrate is 115200. The next part of +converter, depending on your board. The baudrate is 115200. The next part of the tutorial will discuss the prompt in more detail. WiFi @@ -137,7 +137,7 @@ WiFi After a fresh install and boot the device configures itself as a WiFi access point (AP) that you can connect to. The ESSID is of the form MicroPython-xxxxxx where the x's are replaced with part of the MAC address of your device (so will -be the same everytime, and most likely different for all ESP8266 chips). The +be the same every time, and most likely different for all ESP8266 chips). The password for the WiFi is micropythoN (note the upper-case N). Its IP address will be 192.168.4.1 once you connect to its network. WiFi configuration will be discussed in more detail later in the tutorial. @@ -169,7 +169,7 @@ after it, here are troubleshooting recommendations: * The flashing instructions above use flashing speed of 460800 baud, which is good compromise between speed and stability. However, depending on your - module/board, USB-UART convertor, cables, host OS, etc., the above baud + module/board, USB-UART converter, cables, host OS, etc., the above baud rate may be too high and lead to errors. Try a more common 115200 baud rate instead in such cases. diff --git a/docs/esp8266/tutorial/repl.rst b/docs/esp8266/tutorial/repl.rst index 196541bd02..bc0142aaef 100644 --- a/docs/esp8266/tutorial/repl.rst +++ b/docs/esp8266/tutorial/repl.rst @@ -13,7 +13,7 @@ REPL over the serial port The REPL is always available on the UART0 serial peripheral, which is connected to the pins GPIO1 for TX and GPIO3 for RX. The baudrate of the REPL is 115200. -If your board has a USB-serial convertor on it then you should be able to access +If your board has a USB-serial converter on it then you should be able to access the REPL directly from your PC. Otherwise you will need to have a way of communicating with the UART. diff --git a/docs/library/array.rst b/docs/library/array.rst index f94cece2b7..f417a7046e 100644 --- a/docs/library/array.rst +++ b/docs/library/array.rst @@ -75,7 +75,7 @@ Classes Returns the string representation of the array, called as ``str(a)`` or ``repr(a)``` (where ``a`` is an ``array``). Returns the string ``"array(, [])"``, where ```` is the type code letter for the array and ```` is a comma - seperated list of the elements of the array. + separated list of the elements of the array. **Note:** ``__repr__`` cannot be called directly (``a.__repr__()`` fails) and is not present in ``__dict__``, however ``str(a)`` and ``repr(a)`` both work. diff --git a/docs/library/bluetooth.rst b/docs/library/bluetooth.rst index dd0f5ffd62..78cb4cc281 100644 --- a/docs/library/bluetooth.rst +++ b/docs/library/bluetooth.rst @@ -44,7 +44,7 @@ Configuration Get or set configuration values of the BLE interface. To get a value the parameter name should be quoted as a string, and just one parameter is - queried at a time. To set values use the keyword syntax, and one ore more + queried at a time. To set values use the keyword syntax, and one or more parameter can be set at a time. Currently supported values are: diff --git a/docs/library/esp32.rst b/docs/library/esp32.rst index f0f0c8ef1f..12d0890217 100644 --- a/docs/library/esp32.rst +++ b/docs/library/esp32.rst @@ -126,7 +126,7 @@ methods to enable over-the-air (OTA) updates. and an ``OSError(-261)`` is raised if called on firmware that doesn't have the feature enabled. It is OK to call ``mark_app_valid_cancel_rollback`` on every boot and it is not - necessary when booting firmare that was loaded using esptool. + necessary when booting firmware that was loaded using esptool. Constants ~~~~~~~~~ diff --git a/docs/library/machine.ADC.rst b/docs/library/machine.ADC.rst index eb538a4424..65225ea878 100644 --- a/docs/library/machine.ADC.rst +++ b/docs/library/machine.ADC.rst @@ -4,7 +4,7 @@ class ADC -- analog to digital conversion ========================================= -The ADC class provides an interface to analog-to-digital convertors, and +The ADC class provides an interface to analog-to-digital converters, and represents a single endpoint that can sample a continuous voltage and convert it to a discretised value. diff --git a/docs/library/machine.I2C.rst b/docs/library/machine.I2C.rst index bfc9f7ebcc..635d587344 100644 --- a/docs/library/machine.I2C.rst +++ b/docs/library/machine.I2C.rst @@ -94,7 +94,7 @@ General Methods - *freq* is the SCL clock rate In the case of hardware I2C the actual clock frequency may be lower than the - requested frequency. This is dependant on the platform hardware. The actual + requested frequency. This is dependent on the platform hardware. The actual rate may be determined by printing the I2C object. .. method:: I2C.deinit() diff --git a/docs/library/machine.I2S.rst b/docs/library/machine.I2S.rst index b602ac6504..2244ef4202 100644 --- a/docs/library/machine.I2S.rst +++ b/docs/library/machine.I2S.rst @@ -103,7 +103,7 @@ Constructor - ``ibuf`` specifies internal buffer length (bytes) For all ports, DMA runs continuously in the background and allows user applications to perform other operations while - sample data is transfered between the internal buffer and the I2S peripheral unit. + sample data is transferred between the internal buffer and the I2S peripheral unit. Increasing the size of the internal buffer has the potential to increase the time that user applications can perform non-I2S operations before underflow (e.g. ``write`` method) or overflow (e.g. ``readinto`` method). diff --git a/docs/library/machine.SPI.rst b/docs/library/machine.SPI.rst index 7b0e8cf406..7c3c4b5832 100644 --- a/docs/library/machine.SPI.rst +++ b/docs/library/machine.SPI.rst @@ -98,7 +98,7 @@ Methods specify them as a tuple of ``pins`` parameter. In the case of hardware SPI the actual clock frequency may be lower than the - requested baudrate. This is dependant on the platform hardware. The actual + requested baudrate. This is dependent on the platform hardware. The actual rate may be determined by printing the SPI object. .. method:: SPI.deinit() diff --git a/docs/library/machine.Timer.rst b/docs/library/machine.Timer.rst index 48c023a11c..44e6594080 100644 --- a/docs/library/machine.Timer.rst +++ b/docs/library/machine.Timer.rst @@ -73,7 +73,7 @@ Methods - ``callback`` - The callable to call upon expiration of the timer period. The callback must take one argument, which is passed the Timer object. The ``callback`` argument shall be specified. Otherwise an exception - will occurr upon timer expiration: + will occur upon timer expiration: ``TypeError: 'NoneType' object isn't callable`` .. method:: Timer.deinit() diff --git a/docs/library/os.rst b/docs/library/os.rst index 19652ee2bc..27a7d2d44a 100644 --- a/docs/library/os.rst +++ b/docs/library/os.rst @@ -86,7 +86,7 @@ Filesystem access .. function:: statvfs(path) - Get the status of a fileystem. + Get the status of a filesystem. Returns a tuple with the filesystem information in the following order: diff --git a/docs/library/pyb.CAN.rst b/docs/library/pyb.CAN.rst index 5ca00b65e5..57a85d54b7 100644 --- a/docs/library/pyb.CAN.rst +++ b/docs/library/pyb.CAN.rst @@ -272,7 +272,7 @@ Methods - *fdf* for CAN FD controllers, if set to True, the frame will have an FD frame format, which supports data payloads up to 64 bytes. - *brs* for CAN FD controllers, if set to True, the bitrate switching mode - is enabled, in which the data phase is transmitted at a differet bitrate. + is enabled, in which the data phase is transmitted at a different bitrate. See :meth:`CAN.init` for the data bit timing configuration parameters. If timeout is 0 the message is placed in a buffer in one of three hardware diff --git a/docs/library/pyb.I2C.rst b/docs/library/pyb.I2C.rst index 2c526854aa..71d043aa6d 100644 --- a/docs/library/pyb.I2C.rst +++ b/docs/library/pyb.I2C.rst @@ -97,7 +97,7 @@ Methods errors properly) The actual clock frequency may be lower than the requested frequency. - This is dependant on the platform hardware. The actual rate may be determined + This is dependent on the platform hardware. The actual rate may be determined by printing the I2C object. .. method:: I2C.is_ready(addr) diff --git a/docs/library/sys.rst b/docs/library/sys.rst index 3efdce964c..c8eb4b5c50 100644 --- a/docs/library/sys.rst +++ b/docs/library/sys.rst @@ -46,7 +46,7 @@ Functions .. function:: settrace(tracefunc) Enable tracing of bytecode execution. For details see the `CPython - documentaion `_. + documentation `_. This function requires a custom MicroPython build as it is typically not present in pre-built firmware (due to it affecting performance). The relevant diff --git a/docs/library/time.rst b/docs/library/time.rst index 3ab5caf248..8c1c1d4d6f 100644 --- a/docs/library/time.rst +++ b/docs/library/time.rst @@ -163,8 +163,8 @@ Functions However, values returned by `ticks_ms()`, etc. functions may wrap around, so directly using subtraction on them will produce incorrect result. That is why `ticks_diff()` is needed, it implements modular (or more specifically, ring) - arithmetics to produce correct result even for wrap-around values (as long as they not - too distant inbetween, see below). The function returns **signed** value in the range + arithmetic to produce correct result even for wrap-around values (as long as they not + too distant in between, see below). The function returns **signed** value in the range [*-TICKS_PERIOD/2* .. *TICKS_PERIOD/2-1*] (that's a typical range definition for two's-complement signed binary integers). If the result is negative, it means that *ticks1* occurred earlier in time than *ticks2*. Otherwise, it means that @@ -183,7 +183,7 @@ Functions has passed. To avoid this mistake, just look at the clock regularly. Your application should do the same. "Too long sleep" metaphor also maps directly to application behaviour: don't let your application run any single task for too long. Run tasks - in steps, and do time-keeping inbetween. + in steps, and do time-keeping in between. `ticks_diff()` is designed to accommodate various usage patterns, among them: diff --git a/docs/library/zephyr.rst b/docs/library/zephyr.rst index da3d14a093..10676d9085 100644 --- a/docs/library/zephyr.rst +++ b/docs/library/zephyr.rst @@ -32,7 +32,7 @@ Functions * *CPU utilization is only printed if runtime statistics are configured via the ``CONFIG_THREAD_RUNTIME_STATS`` kconfig* This function can only be accessed if ``CONFIG_THREAD_ANALYZER`` is configured for the port in ``zephyr/prj.conf``. - For more infomation, see documentation for Zephyr `thread analyzer + For more information, see documentation for Zephyr `thread analyzer `_. .. function:: shell_exec(cmd_in) diff --git a/docs/pyboard/tutorial/usb_mouse.rst b/docs/pyboard/tutorial/usb_mouse.rst index d05b16ed5c..31b463668f 100644 --- a/docs/pyboard/tutorial/usb_mouse.rst +++ b/docs/pyboard/tutorial/usb_mouse.rst @@ -120,7 +120,7 @@ minus sign in front of the y-coordinate in the ``hid.send()`` line above. Restoring your pyboard to normal -------------------------------- -If you leave your pyboard as-is, it'll behave as a mouse everytime you plug +If you leave your pyboard as-is, it'll behave as a mouse every time you plug it in. You probably want to change it back to normal. To do this you need to first enter safe mode (see above), and then edit the ``boot.py`` file. In the ``boot.py`` file, comment out (put a # in front of) the line with the diff --git a/docs/reference/asm_thumb2_compare.rst b/docs/reference/asm_thumb2_compare.rst index 521af69da3..5258195503 100644 --- a/docs/reference/asm_thumb2_compare.rst +++ b/docs/reference/asm_thumb2_compare.rst @@ -75,7 +75,7 @@ Execute the next instruction if is true: * ite() If then else -If is true, execute the next instruction, otherwise execute the +If is true, execute the next instruction, otherwise execute the subsequent one. Thus: :: @@ -86,5 +86,5 @@ subsequent one. Thus: mov(r0, 200) # runs if r0 != r1 # execution continues here -This may be extended to control the execution of upto four subsequent instructions: it[x[y[z]]] +This may be extended to control the execution of up to four subsequent instructions: it[x[y[z]]] where x,y,z=t/e; e.g. itt, itee, itete, ittte, itttt, iteee, etc. diff --git a/docs/reference/constrained.rst b/docs/reference/constrained.rst index 2bcf9f7fb7..59c375159b 100644 --- a/docs/reference/constrained.rst +++ b/docs/reference/constrained.rst @@ -264,7 +264,7 @@ were a string. **Runtime compiler execution** -The Python funcitons `eval` and `exec` invoke the compiler at runtime, which +The Python functions `eval` and `exec` invoke the compiler at runtime, which requires significant amounts of RAM. Note that the ``pickle`` library from `micropython-lib` employs `exec`. It may be more RAM efficient to use the `json` library for object serialisation. @@ -403,7 +403,7 @@ Control of garbage collection ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A GC can be demanded at any time by issuing `gc.collect()`. It is advantageous -to do this at intervals, firstly to pre-empt fragmentation and secondly for +to do this at intervals, firstly to preempt fragmentation and secondly for performance. A GC can take several milliseconds but is quicker when there is little work to do (about 1ms on the Pyboard). An explicit call can minimise that delay while ensuring it occurs at points in the program when it is acceptable. diff --git a/docs/rp2/general.rst b/docs/rp2/general.rst index 6a8958d172..05b44f051e 100644 --- a/docs/rp2/general.rst +++ b/docs/rp2/general.rst @@ -30,7 +30,7 @@ The peripherals include: * 2 UARTs * 2 SPI controllers -* 2 I2C contollers +* 2 I2C controllers * 16 PWM channels * USB 1.1 controller * 8 PIO state machines diff --git a/docs/rp2/quickref.rst b/docs/rp2/quickref.rst index 430c130c6e..67a5cc0dfc 100644 --- a/docs/rp2/quickref.rst +++ b/docs/rp2/quickref.rst @@ -96,7 +96,7 @@ Programmable IO (PIO) --------------------- PIO is useful to build low-level IO interfaces from scratch. See the :mod:`rp2` module -for detailed explaination of the assembly instructions. +for detailed explanation of the assembly instructions. Example using PIO to blink an LED at 1Hz:: diff --git a/docs/zephyr/tutorial/repl.rst b/docs/zephyr/tutorial/repl.rst index 8cd57c9435..2c091f7ee9 100644 --- a/docs/zephyr/tutorial/repl.rst +++ b/docs/zephyr/tutorial/repl.rst @@ -10,7 +10,7 @@ REPL over the serial port The REPL is available on a UART serial peripheral specified for the board by the ``zephyr,console`` devicetree node. The baudrate of the REPL is 115200. -If your board has a USB-serial convertor on it then you should be able to access +If your board has a USB-serial converter on it then you should be able to access the REPL directly from your PC. To access the prompt over USB-serial you will need to use a terminal emulator diff --git a/drivers/cyw43/cywbt.c b/drivers/cyw43/cywbt.c index 33e749bbf9..006fd28e90 100644 --- a/drivers/cyw43/cywbt.c +++ b/drivers/cyw43/cywbt.c @@ -67,7 +67,7 @@ STATIC int cywbt_hci_cmd_raw(size_t len, uint8_t *buf) { buf[i] = uart_rx_char(&mp_bluetooth_hci_uart_obj); } - // expect a comand complete event (event 0x0e) + // expect a command complete event (event 0x0e) if (buf[0] != 0x04 || buf[1] != 0x0e) { printf("unknown response: %02x %02x %02x %02x\n", buf[0], buf[1], buf[2], buf[3]); return -1; diff --git a/drivers/ninaw10/nina_wifi_drv.c b/drivers/ninaw10/nina_wifi_drv.c index 22ad0aae70..111ead003d 100644 --- a/drivers/ninaw10/nina_wifi_drv.c +++ b/drivers/ninaw10/nina_wifi_drv.c @@ -105,7 +105,7 @@ typedef enum { NINA_CMD_AP_GET_BSSID = 0x3C, NINA_CMD_AP_GET_CHANNEL = 0x3D, - // Disonnect/status commands. + // Disconnect/status commands. NINA_CMD_DISCONNECT = 0x30, NINA_CMD_CONN_STATUS = 0x20, NINA_CMD_CONN_REASON = 0x1F, diff --git a/examples/embedding/README.md b/examples/embedding/README.md index e3683acdc2..3f19aff41f 100644 --- a/examples/embedding/README.md +++ b/examples/embedding/README.md @@ -23,7 +23,7 @@ To build the example project, based on `main.c`, use: $ make -That will create an exacutable called `embed` which you can run: +That will create an executable called `embed` which you can run: $ ./embed diff --git a/examples/hwapi/README.md b/examples/hwapi/README.md index df16b4c86b..f3de752f9c 100644 --- a/examples/hwapi/README.md +++ b/examples/hwapi/README.md @@ -5,7 +5,7 @@ which would work from a board to board, from a system to another systems. This is inherently a hard problem, because hardware is different from one board type to another, and even from examplar of board to another. For example, if your app requires an external LED, one user may connect it -to one GPIO pin, while another user may find it much more convinient to +to one GPIO pin, while another user may find it much more convenient to use another pin. This of course applies to relays, buzzers, sensors, etc. With complications above in mind, it's still possible to write portable diff --git a/examples/hwapi/hwconfig_pyboard.py b/examples/hwapi/hwconfig_pyboard.py index a74a1ae151..cb77e9f2d6 100644 --- a/examples/hwapi/hwconfig_pyboard.py +++ b/examples/hwapi/hwconfig_pyboard.py @@ -1,6 +1,6 @@ from machine import Pin, Signal -# Red LED on pin LED_RED also kown as A13 +# Red LED on pin LED_RED also known as A13 LED = Signal("LED_RED", Pin.OUT) # Green LED on pin LED_GREEN also known as A14 diff --git a/examples/natmod/features1/features1.c b/examples/natmod/features1/features1.c index f865f1887c..d2494b2138 100644 --- a/examples/natmod/features1/features1.c +++ b/examples/natmod/features1/features1.c @@ -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 usual mp_printf(&mp_plat_print, "initialising module self=%p\n", self); // Make the functions available in the module's namespace diff --git a/extmod/btstack/modbluetooth_btstack.c b/extmod/btstack/modbluetooth_btstack.c index 0e29c38efd..183c85a445 100644 --- a/extmod/btstack/modbluetooth_btstack.c +++ b/extmod/btstack/modbluetooth_btstack.c @@ -883,7 +883,7 @@ int mp_bluetooth_gatts_register_service_begin(bool append) { if (!append) { // This will reset the DB. - // Becase the DB is statically allocated, there's no problem with just re-initing it. + // Because the DB is statically allocated, there's no problem with just re-initing it. // Note this would be a memory leak if we enabled HAVE_MALLOC (there's no API to free the existing db). att_db_util_init(); diff --git a/extmod/moduplatform.h b/extmod/moduplatform.h index 42ed4de248..3597f7559f 100644 --- a/extmod/moduplatform.h +++ b/extmod/moduplatform.h @@ -29,7 +29,7 @@ #include "py/misc.h" // For MP_STRINGIFY. #include "py/mpconfig.h" -// Preprocessor directives indentifying the platform. +// Preprocessor directives identifying the platform. // The (u)platform module itself is guarded by MICROPY_PY_UPLATFORM, see the // .c file, but these are made available because they're generally usable. // TODO: Add more architectures, compilers and libraries. diff --git a/extmod/modussl_axtls.c b/extmod/modussl_axtls.c index 2eae465048..77e942ec12 100644 --- a/extmod/modussl_axtls.c +++ b/extmod/modussl_axtls.c @@ -208,7 +208,7 @@ STATIC mp_uint_t ussl_socket_read(mp_obj_t o_in, void *buf, mp_uint_t size, int // default is to perform complete handshake in constructor, so // this should not happen in blocking mode. On the other hand, // in nonblocking mode EAGAIN (comparing to the alternative of - // looping) is really preferrable. + // looping) is really preferable. if (o->blocking) { continue; } else { diff --git a/extmod/modussl_mbedtls.c b/extmod/modussl_mbedtls.c index eea2d79532..74a59fdb67 100644 --- a/extmod/modussl_mbedtls.c +++ b/extmod/modussl_mbedtls.c @@ -333,7 +333,7 @@ STATIC mp_uint_t socket_read(mp_obj_t o_in, void *buf, mp_uint_t size, int *errc } 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; o->poll_mask = MP_STREAM_POLL_WR; } else { @@ -361,7 +361,7 @@ STATIC mp_uint_t socket_write(mp_obj_t o_in, const void *buf, mp_uint_t size, in } 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; o->poll_mask = MP_STREAM_POLL_RD; } else { diff --git a/extmod/nimble/hal/hal_uart.c b/extmod/nimble/hal/hal_uart.c index 7713f75d8d..f4a9319c8b 100644 --- a/extmod/nimble/hal/hal_uart.c +++ b/extmod/nimble/hal/hal_uart.c @@ -84,7 +84,7 @@ void hal_uart_start_tx(uint32_t port) { mp_bluetooth_hci_uart_write(mp_bluetooth_hci_cmd_buf, len); if (len > 0) { - // Allow modbluetooth bindings to hook "sent packet" (e.g. to unstall l2cap channels). + // Allow modbluetooth bindings to hook "sent packet" (e.g. to un-stall l2cap channels). mp_bluetooth_nimble_sent_hci_packet(); } } diff --git a/extmod/nimble/modbluetooth_nimble.c b/extmod/nimble/modbluetooth_nimble.c index d9d4c13223..e23ffbf0f9 100644 --- a/extmod/nimble/modbluetooth_nimble.c +++ b/extmod/nimble/modbluetooth_nimble.c @@ -652,7 +652,7 @@ int mp_bluetooth_init(void) { // By default, just register the default gap/gatt service. ble_svc_gap_init(); ble_svc_gatt_init(); - // The preceeding two calls allocate service definitions on the heap, + // The preceding two calls allocate service definitions on the heap, // then we must now call gatts_start to register those services // and free the heap memory. // Otherwise it will be realloc'ed on the next stack startup. @@ -1537,7 +1537,7 @@ STATIC void destroy_l2cap_channel() { STATIC void unstall_l2cap_channel(void) { // Whenever we send an HCI packet and the sys mempool is now less than 1/4 full, - // we can unstall the L2CAP channel if it was marked as "mem_stalled" by + // we can un-stall the L2CAP channel if it was marked as "mem_stalled" by // mp_bluetooth_l2cap_send. (This happens if the pool is half-empty). mp_bluetooth_nimble_l2cap_channel_t *chan = MP_STATE_PORT(bluetooth_nimble_root_pointers)->l2cap_chan; if (!chan || !chan->mem_stalled) { @@ -1644,7 +1644,7 @@ STATIC int l2cap_channel_event(struct ble_l2cap_event *event, void *arg) { case BLE_L2CAP_EVENT_COC_TX_UNSTALLED: { DEBUG_printf("l2cap_channel_event: tx_unstalled: conn_handle=%d status=%d\n", event->tx_unstalled.conn_handle, event->tx_unstalled.status); assert(event->tx_unstalled.conn_handle == chan->chan->conn_handle); - // Don't unstall if we're still waiting for room in the sys pool. + // Don't un-stall if we're still waiting for room in the sys pool. if (!chan->mem_stalled) { ble_l2cap_get_chan_info(event->receive.chan, &info); // Map status to {0,1} (i.e. "sent everything", or "partial send"). @@ -1802,7 +1802,7 @@ int mp_bluetooth_l2cap_send(uint16_t conn_handle, uint16_t cid, const uint8_t *b err = ble_l2cap_send(chan->chan, sdu_tx); if (err == BLE_HS_ESTALLED) { // Stalled means that this one will still send but any future ones - // will fail until we receive an unstalled event. + // will fail until we receive an un-stalled event. DEBUG_printf("mp_bluetooth_l2cap_send: credit stall\n"); *stalled = true; err = 0; diff --git a/ports/cc3200/bootmgr/main.c b/ports/cc3200/bootmgr/main.c index cfb8dec21d..6feeec79a3 100644 --- a/ports/cc3200/bootmgr/main.c +++ b/ports/cc3200/bootmgr/main.c @@ -256,7 +256,7 @@ static bool wait_while_blinking (uint32_t wait_time, uint32_t period, bool force _u32 count; for (count = 0; (force_wait || MAP_GPIOPinRead(MICROPY_SAFE_BOOT_PORT, MICROPY_SAFE_BOOT_PORT_PIN)) && ((period * count) < wait_time); count++) { - // toogle the led + // toggle the led MAP_GPIOPinWrite(MICROPY_SYS_LED_PORT, MICROPY_SYS_LED_PORT_PIN, ~MAP_GPIOPinRead(MICROPY_SYS_LED_PORT, MICROPY_SYS_LED_PORT_PIN)); UtilsDelay(UTILS_DELAY_US_TO_COUNT(period * 1000)); } diff --git a/ports/cc3200/fatfs/src/drivers/sd_diskio.c b/ports/cc3200/fatfs/src/drivers/sd_diskio.c index 0a1379181b..329ae04b99 100644 --- a/ports/cc3200/fatfs/src/drivers/sd_diskio.c +++ b/ports/cc3200/fatfs/src/drivers/sd_diskio.c @@ -269,7 +269,7 @@ DSTATUS sd_disk_init (void) { // Fill in the RCA sd_disk_info.usRCA = (ulResp[0] >> 16); - // Get tha card capacity + // Get the card capacity CardCapacityGet(&sd_disk_info); } diff --git a/ports/cc3200/ftp/ftp.c b/ports/cc3200/ftp/ftp.c index d999e810d9..173bb7c2c0 100644 --- a/ports/cc3200/ftp/ftp.c +++ b/ports/cc3200/ftp/ftp.c @@ -97,7 +97,7 @@ typedef enum { typedef struct { bool uservalid : 1; bool passvalid : 1; -} ftp_loggin_t; +} ftp_login_t; typedef enum { E_FTP_NOTHING_OPEN = 0, @@ -127,8 +127,8 @@ typedef struct { uint8_t state; uint8_t substate; uint8_t txRetries; - uint8_t logginRetries; - ftp_loggin_t loggin; + uint8_t loginRetries; + ftp_login_t login; uint8_t e_open; bool closechild; bool enabled; @@ -329,10 +329,10 @@ void ftp_run (void) { if (ftp_data.c_sd < 0 && ftp_data.substate == E_FTP_STE_SUB_DISCONNECTED) { if (E_FTP_RESULT_OK == ftp_wait_for_connection(ftp_data.lc_sd, &ftp_data.c_sd)) { ftp_data.txRetries = 0; - ftp_data.logginRetries = 0; + ftp_data.loginRetries = 0; ftp_data.ctimeout = 0; - ftp_data.loggin.uservalid = false; - ftp_data.loggin.passvalid = false; + ftp_data.login.uservalid = false; + ftp_data.login.passvalid = false; strcpy (ftp_path, "/"); ftp_send_reply (220, "MicroPython FTP Server"); break; @@ -684,7 +684,7 @@ static void ftp_process_cmd (void) { if (E_FTP_RESULT_OK == (result = ftp_recv_non_blocking(ftp_data.c_sd, ftp_cmd_buffer, FTP_MAX_PARAM_SIZE + FTP_CMD_SIZE_MAX, &len))) { // bufptr is moved as commands are being popped ftp_cmd_index_t cmd = ftp_pop_command(&bufptr); - if (!ftp_data.loggin.passvalid && (cmd != E_FTP_CMD_USER && cmd != E_FTP_CMD_PASS && cmd != E_FTP_CMD_QUIT && cmd != E_FTP_CMD_FEAT)) { + if (!ftp_data.login.passvalid && (cmd != E_FTP_CMD_USER && cmd != E_FTP_CMD_PASS && cmd != E_FTP_CMD_QUIT && cmd != E_FTP_CMD_FEAT)) { ftp_send_reply(332, NULL); return; } @@ -754,16 +754,16 @@ static void ftp_process_cmd (void) { case E_FTP_CMD_USER: ftp_pop_param (&bufptr, ftp_scratch_buffer); if (!memcmp(ftp_scratch_buffer, servers_user, MAX(strlen(ftp_scratch_buffer), strlen(servers_user)))) { - ftp_data.loggin.uservalid = true && (strlen(servers_user) == strlen(ftp_scratch_buffer)); + ftp_data.login.uservalid = true && (strlen(servers_user) == strlen(ftp_scratch_buffer)); } ftp_send_reply(331, NULL); break; case E_FTP_CMD_PASS: ftp_pop_param (&bufptr, ftp_scratch_buffer); if (!memcmp(ftp_scratch_buffer, servers_pass, MAX(strlen(ftp_scratch_buffer), strlen(servers_pass))) && - ftp_data.loggin.uservalid) { - ftp_data.loggin.passvalid = true && (strlen(servers_pass) == strlen(ftp_scratch_buffer)); - if (ftp_data.loggin.passvalid) { + ftp_data.login.uservalid) { + ftp_data.login.passvalid = true && (strlen(servers_pass) == strlen(ftp_scratch_buffer)); + if (ftp_data.login.passvalid) { ftp_send_reply(230, NULL); break; } diff --git a/ports/cc3200/misc/mperror.c b/ports/cc3200/misc/mperror.c index 082d940e2f..6d6c0ff0ba 100644 --- a/ports/cc3200/misc/mperror.c +++ b/ports/cc3200/misc/mperror.c @@ -127,7 +127,7 @@ void mperror_deinit_sfe_pin (void) { void mperror_signal_error (void) { uint32_t count = 0; while ((MPERROR_TOOGLE_MS * count++) < MPERROR_SIGNAL_ERROR_MS) { - // toogle the led + // toggle the led MAP_GPIOPinWrite(MICROPY_SYS_LED_PORT, MICROPY_SYS_LED_PORT_PIN, ~MAP_GPIOPinRead(MICROPY_SYS_LED_PORT, MICROPY_SYS_LED_PORT_PIN)); UtilsDelay(UTILS_DELAY_US_TO_COUNT(MPERROR_TOOGLE_MS * 1000)); } diff --git a/ports/cc3200/mods/modwlan.c b/ports/cc3200/mods/modwlan.c index ca18b34823..bf243ce7b9 100644 --- a/ports/cc3200/mods/modwlan.c +++ b/ports/cc3200/mods/modwlan.c @@ -432,7 +432,7 @@ void wlan_sl_init (int8_t mode, const char *ssid, uint8_t ssid_len, uint8_t auth // switch to the requested mode wlan_set_mode(mode); - // stop and start again (we need to in the propper mode from now on) + // stop and start again (we need to be in the proper mode from now on) wlan_reenable(mode); // Set Tx power level for station or AP mode @@ -608,7 +608,7 @@ STATIC void wlan_set_ssid (const char *ssid, uint8_t len, bool add_mac) { // save the ssid memcpy(&wlan_obj.ssid, ssid, len); // append the last 2 bytes of the MAC address, since the use of this functionality is under our control - // we can assume that the lenght of the ssid is less than (32 - 5) + // we can assume that the length of the ssid is less than (32 - 5) if (add_mac) { snprintf((char *)&wlan_obj.ssid[len], sizeof(wlan_obj.ssid) - len, "-%02x%02x", wlan_obj.mac[4], wlan_obj.mac[5]); len += 5; diff --git a/ports/cc3200/mods/pybpin.c b/ports/cc3200/mods/pybpin.c index f04ca75654..6d10abab57 100644 --- a/ports/cc3200/mods/pybpin.c +++ b/ports/cc3200/mods/pybpin.c @@ -113,7 +113,7 @@ STATIC pybpin_wake_pin_t pybpin_wake_pin[PYBPIN_NUM_WAKE_PINS] = DEFINE PUBLIC FUNCTIONS ******************************************************************************/ void pin_init0(void) { -// this initalization also reconfigures the JTAG/SWD pins +// this initialization also reconfigures the JTAG/SWD pins #ifndef DEBUG // assign all pins to the GPIO module so that peripherals can be connected to any // pins without conflicts after a soft reset @@ -560,7 +560,7 @@ STATIC mp_obj_t pin_obj_init_helper(pin_obj_t *self, size_t n_args, const mp_obj } } - // get the strenght + // get the strength uint strength = args[3].u_int; pin_validate_drive(strength); diff --git a/ports/cc3200/mods/pybrtc.c b/ports/cc3200/mods/pybrtc.c index 21e729dbf1..e79fb29d00 100644 --- a/ports/cc3200/mods/pybrtc.c +++ b/ports/cc3200/mods/pybrtc.c @@ -76,7 +76,7 @@ STATIC void rtc_msec_add(uint16_t msecs_1, uint32_t *secs, uint16_t *msecs_2); ******************************************************************************/ __attribute__ ((section (".boot"))) void pyb_rtc_pre_init(void) { - // only if comming out of a power-on reset + // only if coming out of a power-on reset if (MAP_PRCMSysResetCauseGet() == PRCM_POWER_ON) { // Mark the RTC in use first MAP_PRCMRTCInUseSet(); @@ -118,7 +118,7 @@ void pyb_rtc_repeat_alarm (pyb_rtc_obj_t *self) { pyb_rtc_get_time(&c_seconds, &c_mseconds); - // substract the time elapsed between waking up and setting up the alarm again + // subtract the time elapsed between waking up and setting up the alarm again int32_t wake_ms = ((c_seconds * 1000) + c_mseconds) - ((self->alarm_time_s * 1000) + self->alarm_time_ms); int32_t next_alarm = self->alarm_ms - wake_ms; next_alarm = next_alarm > 0 ? next_alarm : PYB_RTC_MIN_ALARM_TIME_MS; diff --git a/ports/cc3200/mods/pybsd.c b/ports/cc3200/mods/pybsd.c index 209c3b5a85..952a117c45 100644 --- a/ports/cc3200/mods/pybsd.c +++ b/ports/cc3200/mods/pybsd.c @@ -71,7 +71,7 @@ STATIC mp_obj_t pyb_sd_deinit (mp_obj_t self_in); /****************************************************************************** DEFINE PRIVATE FUNCTIONS ******************************************************************************/ -/// Initalizes the sd card hardware driver +/// Initializes the sd card hardware driver STATIC void pyb_sd_hw_init (pybsd_obj_t *self) { if (self->pin_clk) { // Configure the clock pin as output only diff --git a/ports/cc3200/mods/pybsleep.c b/ports/cc3200/mods/pybsleep.c index ffb281e6b1..ea2642c260 100644 --- a/ports/cc3200/mods/pybsleep.c +++ b/ports/cc3200/mods/pybsleep.c @@ -160,13 +160,13 @@ void pyb_sleep_init0 (void) { // register and enable the PRCM interrupt osi_InterruptRegister(INT_PRCM, (P_OSI_INTR_ENTRY)PRCMInterruptHandler, INT_PRIORITY_LVL_1); - // disable all LPDS and hibernate wake up sources (WLAN is disabed/enabled before entering LDPS mode) + // disable all LPDS and hibernate wake up sources (WLAN is disabled/enabled before entering LDPS mode) MAP_PRCMLPDSWakeupSourceDisable(PRCM_LPDS_GPIO); MAP_PRCMLPDSWakeupSourceDisable(PRCM_LPDS_TIMER); MAP_PRCMHibernateWakeupSourceDisable(PRCM_HIB_SLOW_CLK_CTR | PRCM_HIB_GPIO2 | PRCM_HIB_GPIO4 | PRCM_HIB_GPIO13 | PRCM_HIB_GPIO17 | PRCM_HIB_GPIO11 | PRCM_HIB_GPIO24 | PRCM_HIB_GPIO26); - // check the reset casue (if it's soft reset, leave it as it is) + // check the reset cause (if it's soft reset, leave it as it is) if (pybsleep_reset_cause != PYB_SLP_SOFT_RESET) { switch (MAP_PRCMSysResetCauseGet()) { case PRCM_POWER_ON: diff --git a/ports/cc3200/mptask.c b/ports/cc3200/mptask.c index 81f00e5384..a9dbf3c4c3 100644 --- a/ports/cc3200/mptask.c +++ b/ports/cc3200/mptask.c @@ -158,7 +158,7 @@ soft_reset: // to enable simplelink and leave it as is wlan_first_start(); } else { - // only if not comming out of hibernate or a soft reset + // only if not coming out of hibernate or a soft reset mptask_enter_ap_mode(); } @@ -315,7 +315,7 @@ STATIC void mptask_init_sflash_filesystem(void) { // create empty main.py mptask_create_main_py(); } else if (res == FR_OK) { - // mount sucessful + // mount successful if (FR_OK != f_stat(&vfs_fat->fatfs, "/main.py", &fno)) { // create empty main.py mptask_create_main_py(); diff --git a/ports/cc3200/serverstask.c b/ports/cc3200/serverstask.c index 03eed8eeb0..4d852447f4 100644 --- a/ports/cc3200/serverstask.c +++ b/ports/cc3200/serverstask.c @@ -111,7 +111,7 @@ void TASK_Servers(void *pvParameters) { ftp_reset(); } // and we should also close all user sockets. We do it here - // for convinience and to save on code size. + // for convenience and to save on code size. modusocket_close_all_user_sockets(); } diff --git a/ports/cc3200/telnet/telnet.c b/ports/cc3200/telnet/telnet.c index c4daac3426..df1fd1c22d 100644 --- a/ports/cc3200/telnet/telnet.c +++ b/ports/cc3200/telnet/telnet.c @@ -407,7 +407,7 @@ static void telnet_process (void) { _i16 rxLen; _i16 maxLen = (telnet_data.rxWindex >= telnet_data.rxRindex) ? (TELNET_RX_BUFFER_SIZE - telnet_data.rxWindex) : ((telnet_data.rxRindex - telnet_data.rxWindex) - 1); - // to avoid an overrrun + // to avoid an overrun maxLen = (telnet_data.rxRindex == 0) ? (maxLen - 1) : maxLen; if (maxLen > 0) { diff --git a/ports/cc3200/util/cryptohash.c b/ports/cc3200/util/cryptohash.c index 909dadc8cf..ebf12e6e36 100644 --- a/ports/cc3200/util/cryptohash.c +++ b/ports/cc3200/util/cryptohash.c @@ -59,7 +59,7 @@ void CRYPTOHASH_SHAMD5Start (uint32_t algo, uint32_t blocklen) { HWREG(SHAMD5_BASE + SHAMD5_O_MODE) |= SHAMD5_MODE_CLOSE_HASH; } - // set the lenght + // set the length HWREG(SHAMD5_BASE + SHAMD5_O_LENGTH) = blocklen; } diff --git a/ports/esp32/machine_pwm.c b/ports/esp32/machine_pwm.c index 79e11d0278..445ac80fb2 100644 --- a/ports/esp32/machine_pwm.c +++ b/ports/esp32/machine_pwm.c @@ -350,7 +350,7 @@ STATIC void set_duty_u16(machine_pwm_obj_t *self, int duty) { /* // Bug: Sometimes duty is not set right now. // Not a bug. It's a feature. The duty is applied at the beginning of the next signal period. - // Bug: It has been experimentally established that the duty is setted during 2 signal periods, but 1 period is expected. + // Bug: It has been experimentally established that the duty is set during 2 signal periods, but 1 period is expected. // See https://github.com/espressif/esp-idf/issues/7288 if (duty != get_duty_u16(self)) { PWM_DBG("set_duty_u16(%u), get_duty_u16():%u, channel_duty:%d, duty_resolution:%d, freq_hz:%d", duty, get_duty_u16(self), channel_duty, timer.duty_resolution, timer.freq_hz); @@ -510,7 +510,7 @@ STATIC void mp_machine_pwm_init_helper(machine_pwm_obj_t *self, } } if ((freq <= 0) || (freq > 40000000)) { - mp_raise_ValueError(MP_ERROR_TEXT("freqency must be from 1Hz to 40MHz")); + mp_raise_ValueError(MP_ERROR_TEXT("frequency must be from 1Hz to 40MHz")); } int timer_idx; @@ -607,7 +607,7 @@ STATIC void mp_machine_pwm_deinit(machine_pwm_obj_t *self) { self->duty_x = 0; } -// Set's and get's methods of PWM class +// Set and get methods of PWM class STATIC mp_obj_t mp_machine_pwm_freq_get(machine_pwm_obj_t *self) { pwm_is_active(self); @@ -617,7 +617,7 @@ STATIC mp_obj_t mp_machine_pwm_freq_get(machine_pwm_obj_t *self) { STATIC void mp_machine_pwm_freq_set(machine_pwm_obj_t *self, mp_int_t freq) { pwm_is_active(self); if ((freq <= 0) || (freq > 40000000)) { - mp_raise_ValueError(MP_ERROR_TEXT("freqency must be from 1Hz to 40MHz")); + mp_raise_ValueError(MP_ERROR_TEXT("frequency must be from 1Hz to 40MHz")); } if (freq == timers[TIMER_IDX(self->mode, self->timer)].freq_hz) { return; diff --git a/ports/esp8266/esppwm.c b/ports/esp8266/esppwm.c index 3b705fb94e..d7ac44a178 100644 --- a/ports/esp8266/esppwm.c +++ b/ports/esp8266/esppwm.c @@ -165,7 +165,7 @@ pwm_start(void) { } } PWM_DBG("2channel:%d,single[0]:%d,[1]:%d,[2]:%d,[3]:%d\n", *local_channel, local_single[0].h_time, local_single[1].h_time, local_single[2].h_time, local_single[3].h_time); - // step 4: cacl delt time + // step 4: calc delta time for (i = *local_channel - 1; i > 0; i--) { local_single[i].h_time -= local_single[i - 1].h_time; } diff --git a/ports/esp8266/hspi_register.h b/ports/esp8266/hspi_register.h index 50ef2fdca3..0d0cf2f747 100644 --- a/ports/esp8266/hspi_register.h +++ b/ports/esp8266/hspi_register.h @@ -79,7 +79,7 @@ #define SPI_MOSI_DELAY_NUM 0x00000007 #define SPI_MOSI_DELAY_NUM_S 23 #define SPI_MOSI_DELAY_MODE 0x00000003 //mode 0 : posedge; data set at positive edge of clk - //mode 1 : negedge + 1 cycle delay, only if freq<10MHz ; data set at negitive edge of clk + //mode 1 : negedge + 1 cycle delay, only if freq<10MHz ; data set at negative edge of clk //mode 2 : Do not use this mode. #define SPI_MOSI_DELAY_MODE_S 21 #define SPI_MISO_DELAY_NUM 0x00000007 diff --git a/ports/esp8266/uart.c b/ports/esp8266/uart.c index 117cd1bf6c..f761ecfd70 100644 --- a/ports/esp8266/uart.c +++ b/ports/esp8266/uart.c @@ -3,7 +3,7 @@ * * FileName: uart.c * - * Description: Two UART mode configration and interrupt handler. + * Description: Two UART mode configuration and interrupt handler. * Check your hardware connection while use this mode. * * Modification history: @@ -164,7 +164,7 @@ uart_os_config(int uart) { *******************************************************************************/ static void uart0_rx_intr_handler(void *para) { - /* uart0 and uart1 intr combine togther, when interrupt occur, see reg 0x3ff20020, bit2, bit0 represents + /* uart0 and uart1 intr combine together, when interrupt occur, see reg 0x3ff20020, bit2, bit0 represents * uart1 and uart0 respectively */ diff --git a/ports/mimxrt/boards/MIMXRT1176_clock_config.c b/ports/mimxrt/boards/MIMXRT1176_clock_config.c index 4e01448ba3..ae02e30fa8 100644 --- a/ports/mimxrt/boards/MIMXRT1176_clock_config.c +++ b/ports/mimxrt/boards/MIMXRT1176_clock_config.c @@ -172,7 +172,7 @@ void BOARD_BootClockRUN(void) { (ANADIG_OSC->OSC_24M_CTRL & ANADIG_OSC_OSC_24M_CTRL_OSC_24M_STABLE_MASK)) { } - /* Swicth both core, M7 Systick and Bus_Lpsr to OscRC48MDiv2 first */ + /* Switch both core, M7 Systick and Bus_Lpsr to OscRC48MDiv2 first */ rootCfg.mux = kCLOCK_M7_ClockRoot_MuxOscRc48MDiv2; rootCfg.div = 1; #if __CORTEX_M == 7 diff --git a/ports/mimxrt/boards/deploy_teensy.md b/ports/mimxrt/boards/deploy_teensy.md index 28da092493..8f533a91fd 100644 --- a/ports/mimxrt/boards/deploy_teensy.md +++ b/ports/mimxrt/boards/deploy_teensy.md @@ -11,7 +11,7 @@ or for Teensy 4.1: teensy_loader_cli --mcu=imxrt1062 -v -w TEENSY41-.hex ``` -Instead of imxrt1062 with the --mcu option, you can as well use the board specic names +Instead of imxrt1062 with the --mcu option, you can as well use the board specific names TEENSY40, TEENSY41 or TEENSY_MICROMOD. When loading the firmware the PJRC boot loader will erase the board file system. diff --git a/ports/mimxrt/hal/flexspi_flash_config.h b/ports/mimxrt/hal/flexspi_flash_config.h index 80526880be..7eaf3192b5 100644 --- a/ports/mimxrt/hal/flexspi_flash_config.h +++ b/ports/mimxrt/hal/flexspi_flash_config.h @@ -123,7 +123,7 @@ enum kFlexSpiDeviceType_SerialNAND = 2, // !< Flash devices are Serial NAND kFlexSpiDeviceType_SerialRAM = 3, // !< Flash devices are Serial RAM/HyperFLASH kFlexSpiDeviceType_MCP_NOR_NAND = 0x12, // !< Flash device is MCP device, A1 is Serial NOR, A2 is Serial NAND - kFlexSpiDeviceType_MCP_NOR_RAM = 0x13, // !< Flash deivce is MCP device, A1 is Serial NOR, A2 is Serial RAMs + kFlexSpiDeviceType_MCP_NOR_RAM = 0x13, // !< Flash device is MCP device, A1 is Serial NOR, A2 is Serial RAMs }; // !@brief Flash Pad Definitions @@ -184,7 +184,7 @@ typedef struct _FlexSPIConfig // ! details uint8_t deviceType; // !< [0x044-0x044] Device Type: See Flash Type Definition for more details uint8_t sflashPadType; // !< [0x045-0x045] Serial Flash Pad Type: 1 - Single, 2 - Dual, 4 - Quad, 8 - Octal - uint8_t serialClkFreq; // !< [0x046-0x046] Serial Flash Frequencey, device specific definitions, See System Boot + uint8_t serialClkFreq; // !< [0x046-0x046] Serial Flash Frequency, device specific definitions, See System Boot // ! Chapter for more details uint8_t lutCustomSeqEnable; // !< [0x047-0x047] LUT customization Enable, it is required if the program/erase cannot // ! be done using 1 LUT sequence, currently, only applicable to HyperFLASH @@ -245,7 +245,7 @@ typedef struct _flexspi_nor_config uint8_t serialNorType; // !< Serial NOR Flash type: 0/1/2/3 uint8_t needExitNoCmdMode; // !< Need to exit NoCmd mode before other IP command uint8_t halfClkForNonReadCmd; // !< Half the Serial Clock for non-read command: true/false - uint8_t needRestoreNoCmdMode; // !< Need to Restore NoCmd mode after IP commmand execution + uint8_t needRestoreNoCmdMode; // !< Need to Restore NoCmd mode after IP command execution uint32_t blockSize; // !< Block size uint32_t reserve2[11]; // !< Reserved for future use } flexspi_nor_config_t; diff --git a/ports/mimxrt/hal/fsl_flexspi_nor_boot.h b/ports/mimxrt/hal/fsl_flexspi_nor_boot.h index fbb8a574f3..58443119d4 100644 --- a/ports/mimxrt/hal/fsl_flexspi_nor_boot.h +++ b/ports/mimxrt/hal/fsl_flexspi_nor_boot.h @@ -97,7 +97,7 @@ typedef struct _boot_data_ { uint32_t start; /* boot start location */ uint32_t size; /* size */ uint32_t plugin; /* plugin flag - 1 if downloaded application is plugin */ - uint32_t placeholder; /* placehoder to make even 0x10 size */ + uint32_t placeholder; /* placeholder to make even 0x10 size */ }BOOT_DATA_T; #if defined(BOARD_FLASH_SIZE) diff --git a/ports/mimxrt/hal/phy/device/phydp83825/fsl_phydp83825.h b/ports/mimxrt/hal/phy/device/phydp83825/fsl_phydp83825.h index 9d6b4fdf78..7d51953f5b 100644 --- a/ports/mimxrt/hal/phy/device/phydp83825/fsl_phydp83825.h +++ b/ports/mimxrt/hal/phy/device/phydp83825/fsl_phydp83825.h @@ -117,7 +117,7 @@ status_t PHY_DP83825_GetLinkStatus(phy_handle_t *handle, bool *status); * @brief Gets the PHY link speed and duplex. * * @brief This function gets the speed and duplex mode of PHY. User can give one of speed - * and duplex address paramter and set the other as NULL if only wants to get one of them. + * and duplex address parameter and set the other as NULL if only wants to get one of them. * * @param handle PHY device handle. * @param speed The address of PHY link speed. diff --git a/ports/mimxrt/hal/phy/device/phydp83848/fsl_phydp83848.h b/ports/mimxrt/hal/phy/device/phydp83848/fsl_phydp83848.h index 7ccc260f7b..6680247e43 100644 --- a/ports/mimxrt/hal/phy/device/phydp83848/fsl_phydp83848.h +++ b/ports/mimxrt/hal/phy/device/phydp83848/fsl_phydp83848.h @@ -117,7 +117,7 @@ status_t PHY_DP83848_GetLinkStatus(phy_handle_t *handle, bool *status); * @brief Gets the PHY link speed and duplex. * * @brief This function gets the speed and duplex mode of PHY. User can give one of speed - * and duplex address paramter and set the other as NULL if only wants to get one of them. + * and duplex address parameter and set the other as NULL if only wants to get one of them. * * @param handle PHY device handle. * @param speed The address of PHY link speed. diff --git a/ports/mimxrt/hal/phy/device/phyksz8081/fsl_phyksz8081.h b/ports/mimxrt/hal/phy/device/phyksz8081/fsl_phyksz8081.h index 5b93c5698a..49e930df66 100644 --- a/ports/mimxrt/hal/phy/device/phyksz8081/fsl_phyksz8081.h +++ b/ports/mimxrt/hal/phy/device/phyksz8081/fsl_phyksz8081.h @@ -117,7 +117,7 @@ status_t PHY_KSZ8081_GetLinkStatus(phy_handle_t *handle, bool *status); * @brief Gets the PHY link speed and duplex. * * @brief This function gets the speed and duplex mode of PHY. User can give one of speed - * and duplex address paramter and set the other as NULL if only wants to get one of them. + * and duplex address parameter and set the other as NULL if only wants to get one of them. * * @param handle PHY device handle. * @param speed The address of PHY link speed. diff --git a/ports/mimxrt/hal/phy/device/phylan8720/fsl_phylan8720.h b/ports/mimxrt/hal/phy/device/phylan8720/fsl_phylan8720.h index 2e8b4e3631..dcd5ebbe79 100644 --- a/ports/mimxrt/hal/phy/device/phylan8720/fsl_phylan8720.h +++ b/ports/mimxrt/hal/phy/device/phylan8720/fsl_phylan8720.h @@ -117,7 +117,7 @@ status_t PHY_LAN8720_GetLinkStatus(phy_handle_t *handle, bool *status); * @brief Gets the PHY link speed and duplex. * * @brief This function gets the speed and duplex mode of PHY. User can give one of speed - * and duplex address paramter and set the other as NULL if only wants to get one of them. + * and duplex address parameter and set the other as NULL if only wants to get one of them. * * @param handle PHY device handle. * @param speed The address of PHY link speed. diff --git a/ports/mimxrt/hal/phy/device/phyrtl8211f/fsl_phyrtl8211f.h b/ports/mimxrt/hal/phy/device/phyrtl8211f/fsl_phyrtl8211f.h index 225c249a6e..0598b25112 100644 --- a/ports/mimxrt/hal/phy/device/phyrtl8211f/fsl_phyrtl8211f.h +++ b/ports/mimxrt/hal/phy/device/phyrtl8211f/fsl_phyrtl8211f.h @@ -117,7 +117,7 @@ status_t PHY_RTL8211F_GetLinkStatus(phy_handle_t *handle, bool *status); * @brief Gets the PHY link speed and duplex. * * @brief This function gets the speed and duplex mode of PHY. User can give one of speed - * and duplex address paramter and set the other as NULL if only wants to get one of them. + * and duplex address parameter and set the other as NULL if only wants to get one of them. * * @param handle PHY device handle. * @param speed The address of PHY link speed. diff --git a/ports/mimxrt/hal/phy/fsl_phy.h b/ports/mimxrt/hal/phy/fsl_phy.h index 6a022d4eae..53edd9d0b6 100644 --- a/ports/mimxrt/hal/phy/fsl_phy.h +++ b/ports/mimxrt/hal/phy/fsl_phy.h @@ -207,7 +207,7 @@ static inline status_t PHY_GetLinkStatus(phy_handle_t *handle, bool *status) { * @brief Gets the PHY link speed and duplex. * * @brief This function gets the speed and duplex mode of PHY. User can give one of speed - * and duplex address paramter and set the other as NULL if only wants to get one of them. + * and duplex address parameter and set the other as NULL if only wants to get one of them. * * @param handle PHY device handle. * @param speed The address of PHY link speed. diff --git a/ports/mimxrt/hal/resethandler_MIMXRT10xx.S b/ports/mimxrt/hal/resethandler_MIMXRT10xx.S index efca1a7ec6..fe933c6d60 100644 --- a/ports/mimxrt/hal/resethandler_MIMXRT10xx.S +++ b/ports/mimxrt/hal/resethandler_MIMXRT10xx.S @@ -60,7 +60,7 @@ Reset_Handler: * linker script. * __etext: End of code section, i.e., begin of data sections to copy from. * __data_start__/__data_end__: RAM address range that data should be - * __noncachedata_start__/__noncachedata_end__ : none cachable region + * __noncachedata_start__/__noncachedata_end__ : non-cacheable region * __ram_function_start__/__ram_function_end__ : ramfunction region * copied to. Both must be aligned to 4 bytes boundary. */ @@ -80,7 +80,7 @@ Reset_Handler: str r0, [r2, r3] bgt .LC0 .LC1: -#else /* code size implemenation */ +#else /* code size implementation */ .LC0: cmp r2, r3 ittt lt @@ -103,7 +103,7 @@ Reset_Handler: str r0, [r2, r3] bgt .LC_ramfunc_copy_start .LC_ramfunc_copy_end: -#else /* code size implemenation */ +#else /* code size implementation */ .LC_ramfunc_copy_start: cmp r2, r3 ittt lt @@ -127,7 +127,7 @@ Reset_Handler: str r0, [r2, r3] bgt .LC2 .LC3: -#else /* code size implemenation */ +#else /* code size implementation */ .LC2: cmp r2, r3 ittt lt diff --git a/ports/mimxrt/machine_i2s.c b/ports/mimxrt/machine_i2s.c index 32daad0853..aa8eabeb0b 100644 --- a/ports/mimxrt/machine_i2s.c +++ b/ports/mimxrt/machine_i2s.c @@ -826,7 +826,7 @@ STATIC bool i2s_init(machine_i2s_obj_t *self) { memset(self->edmaTcd, 0, sizeof(edma_tcd_t)); - // continuous DMA operation is acheived using the scatter/gather feature, with one TCD linked back to itself + // continuous DMA operation is achieved using the scatter/gather feature, with one TCD linked back to itself EDMA_TcdSetTransferConfig(self->edmaTcd, &transferConfig, self->edmaTcd); EDMA_TcdEnableInterrupts(self->edmaTcd, kEDMA_MajorInterruptEnable | kEDMA_HalfInterruptEnable); EDMA_InstallTCD(DMA0, self->dma_channel, self->edmaTcd); diff --git a/ports/mimxrt/machine_pwm.c b/ports/mimxrt/machine_pwm.c index 661ec16658..c1d6bdf7a6 100644 --- a/ports/mimxrt/machine_pwm.c +++ b/ports/mimxrt/machine_pwm.c @@ -137,7 +137,7 @@ STATIC uint8_t channel_decode(char channel) { } } -// decode the AF objects module and Port numer. Returns NULL if it is not a FLEXPWM object +// decode the AF objects module and Port number. Returns NULL if it is not a FLEXPWM object STATIC const machine_pin_af_obj_t *af_name_decode_flexpwm(const machine_pin_af_obj_t *af_obj, uint8_t *module, uint8_t *submodule, uint8_t *channel) { const char *str; @@ -171,7 +171,7 @@ STATIC uint8_t qtmr_decode(char channel) { } } -// decode the AF objects module and Port numer. Returns NULL if it is not a QTMR object +// decode the AF objects module and Port number. Returns NULL if it is not a QTMR object STATIC const machine_pin_af_obj_t *af_name_decode_qtmr(const machine_pin_af_obj_t *af_obj, uint8_t *module, uint8_t *channel) { const char *str; size_t len; @@ -558,7 +558,7 @@ void machine_pwm_deinit_all(void) { for (int i = 1; i < ARRAY_SIZE(pwm_bases); i++) { PWM_StopTimer(pwm_bases[i], 0x0f); // Stop all submodules - pwm_bases[i]->OUTEN = 0; // Disable ouput on all submodules, all channels + pwm_bases[i]->OUTEN = 0; // Disable output on all submodules, all channels } #ifdef FSL_FEATURE_SOC_TMR_COUNT diff --git a/ports/mimxrt/mphalport.h b/ports/mimxrt/mphalport.h index 5136a36b38..ba7e1cfa94 100644 --- a/ports/mimxrt/mphalport.h +++ b/ports/mimxrt/mphalport.h @@ -40,7 +40,7 @@ #define MP_HAL_PIN_FMT "%q" extern ringbuf_t stdin_ringbuf; -// Define an alias fo systick_ms, because the shared softtimer.c uses +// Define an alias for systick_ms, because the shared softtimer.c uses // the symbol uwTick for the systick ms counter. #define uwTick systick_ms diff --git a/ports/mimxrt/sdcard.c b/ports/mimxrt/sdcard.c index 1d54859901..76d303aad0 100644 --- a/ports/mimxrt/sdcard.c +++ b/ports/mimxrt/sdcard.c @@ -223,7 +223,7 @@ void sdcard_card_removed_callback(USDHC_Type *base, void *userData); void sdcard_transfer_complete_callback(USDHC_Type *base, usdhc_handle_t *handle, status_t status, void *userData); void sdcard_dummy_callback(USDHC_Type *base, void *userData); -// SD Card commmands +// SD Card commands static bool sdcard_cmd_go_idle_state(mimxrt_sdcard_obj_t *card); static bool sdcard_cmd_oper_cond(mimxrt_sdcard_obj_t *card); static bool sdcard_cmd_app_cmd(mimxrt_sdcard_obj_t *card); diff --git a/ports/minimal/stm32f405.ld b/ports/minimal/stm32f405.ld index a202294a54..6a275440cf 100644 --- a/ports/minimal/stm32f405.ld +++ b/ports/minimal/stm32f405.ld @@ -28,7 +28,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 /* This is the initialized data section diff --git a/ports/nrf/README.md b/ports/nrf/README.md index a833f0f17c..fde04e61f1 100644 --- a/ports/nrf/README.md +++ b/ports/nrf/README.md @@ -98,7 +98,7 @@ Note: further tuning of features to include in bluetooth or even setting up the ## Compile with freeze manifest -Freeze manifests can be used by definining `FROZEN_MANIFEST` pointing to a +Freeze manifests can be used by defining `FROZEN_MANIFEST` pointing to a `manifest.py`. This can either be done by a `make` invocation or by defining it in the specific target board's `mpconfigboard.mk`. @@ -132,8 +132,8 @@ For example: ## Set file system size The size of the file system on the internal flash is configured by the linker -script parameter `_fs_size`. This can either be overriden by the linker script -or dynamically through the makefile. By seting a value to the `FS_SIZE`. +script parameter `_fs_size`. This can either be overridden by the linker script +or dynamically through the makefile. By setting a value to the `FS_SIZE`. The number will be passed directly to the linker scripts in order to calculate the start and end of the file system. Note that the parameter value must be in linker script syntax as it is passed directly. @@ -215,7 +215,7 @@ Install the necessary Python packages that will be used for flashing using the b The `intelhex` provides the `hexmerge.py` utility which is used by the Makefile to trim of the MBR in case SoftDevice flashing is requested. -`nrfutil` as flashing backend also requires a serial port paramter to be defined +`nrfutil` as flashing backend also requires a serial port parameter to be defined in addition to the `deploy` target of make. For example: make BOARD=nrf52840-mdk-usb-dongle NRFUTIL_PORT=/dev/ttyACM0 deploy diff --git a/ports/nrf/boards/arduino_nano_33_ble_sense/modules/imu.py b/ports/nrf/boards/arduino_nano_33_ble_sense/modules/imu.py index 50a36a1976..821795e17c 100644 --- a/ports/nrf/boards/arduino_nano_33_ble_sense/modules/imu.py +++ b/ports/nrf/boards/arduino_nano_33_ble_sense/modules/imu.py @@ -23,7 +23,7 @@ import time class IMU: def __init__(self, bus): - """Initalizes Gyro, Accelerometer and Magnetometer using default values.""" + """Initializes Gyro, Accelerometer and Magnetometer using default values.""" if 0x68 in bus.scan(): from bmm150 import BMM150 from bmi270 import BMI270 diff --git a/ports/nrf/boards/make-pins.py b/ports/nrf/boards/make-pins.py index 347ed15b21..720df6e49e 100644 --- a/ports/nrf/boards/make-pins.py +++ b/ports/nrf/boards/make-pins.py @@ -13,7 +13,7 @@ SUPPORTED_FN = {"UART": ["RX", "TX", "CTS", "RTS"]} def parse_pin(name_str): """Parses a string and returns a pin-num.""" if len(name_str) < 1: - raise ValueError("Expecting pin name to be at least 4 charcters.") + raise ValueError("Expecting pin name to be at least 4 characters.") if name_str[0] != "P": raise ValueError("Expecting pin name to start with P") pin_str = name_str[1:].split("/")[0] diff --git a/ports/nrf/boards/microbit/modules/microbitimage.c b/ports/nrf/boards/microbit/modules/microbitimage.c index fc6b18870b..08ef4babcf 100644 --- a/ports/nrf/boards/microbit/modules/microbitimage.c +++ b/ports/nrf/boards/microbit/modules/microbitimage.c @@ -219,7 +219,7 @@ STATIC mp_obj_t microbit_image_make_new(const mp_obj_type_t *type_in, mp_uint_t const char *str = mp_obj_str_get_data(args[0], &len); // make image from string if (len == 1) { - /* For a single charater, return the font glyph */ + /* For a single character, return the font glyph */ return microbit_image_for_char(str[0]); } else { /* Otherwise parse the image description string */ @@ -305,7 +305,7 @@ STATIC void image_blit(microbit_image_obj_t *src, greyscale_t *dest, mp_int_t x, greyscaleSetPixelValue(dest, i+xdest-x, j+ydest-y, val); } } - // Adjust intersection rectange to dest + // Adjust intersection rectangle to dest intersect_x0 += xdest-x; intersect_y0 += ydest-y; intersect_x1 += xdest-x; diff --git a/ports/nrf/drivers/bluetooth/ble_drv.c b/ports/nrf/drivers/bluetooth/ble_drv.c index 173d3eda01..078c7d995b 100644 --- a/ports/nrf/drivers/bluetooth/ble_drv.c +++ b/ports/nrf/drivers/bluetooth/ble_drv.c @@ -480,7 +480,7 @@ bool ble_drv_advertise_data(ubluepy_advertise_data_t * p_adv_params) { // do encoding into the adv buffer if (sd_ble_uuid_encode(&uuid, &encoded_size, &adv_data[byte_pos]) != 0) { - mp_raise_msg(&mp_type_OSError, MP_ERROR_TEXT("can't encode UUID into advertisment packet")); + mp_raise_msg(&mp_type_OSError, MP_ERROR_TEXT("can't encode UUID into advertisement packet")); } BLE_DRIVER_LOG("encoded uuid for service %u: ", 0); @@ -528,7 +528,7 @@ bool ble_drv_advertise_data(ubluepy_advertise_data_t * p_adv_params) { // do encoding into the adv buffer if (sd_ble_uuid_encode(&uuid, &encoded_size, &adv_data[byte_pos]) != 0) { - mp_raise_msg(&mp_type_OSError, MP_ERROR_TEXT("can't encode UUID into advertisment packet")); + mp_raise_msg(&mp_type_OSError, MP_ERROR_TEXT("can't encode UUID into advertisement packet")); } BLE_DRIVER_LOG("encoded uuid for service %u: ", 0); @@ -552,7 +552,7 @@ bool ble_drv_advertise_data(ubluepy_advertise_data_t * p_adv_params) { if ((p_adv_params->data_len > 0) && (p_adv_params->p_data != NULL)) { if (p_adv_params->data_len + byte_pos > BLE_GAP_ADV_MAX_SIZE) { - mp_raise_msg(&mp_type_OSError, MP_ERROR_TEXT("can't fit data into advertisment packet")); + mp_raise_msg(&mp_type_OSError, MP_ERROR_TEXT("can't fit data into advertisement packet")); } memcpy(adv_data, p_adv_params->p_data, p_adv_params->data_len); @@ -590,12 +590,12 @@ bool ble_drv_advertise_data(ubluepy_advertise_data_t * p_adv_params) { #if (BLUETOOTH_SD == 110) m_adv_params.fp = BLE_GAP_ADV_FP_ANY; - m_adv_params.timeout = 0; // infinite advertisment + m_adv_params.timeout = 0; // infinite advertisement #else m_adv_params.properties.anonymous = 0; m_adv_params.properties.include_tx_power = 0; m_adv_params.filter_policy = 0; - m_adv_params.max_adv_evts = 0; // infinite advertisment + m_adv_params.max_adv_evts = 0; // infinite advertisement m_adv_params.primary_phy = BLE_GAP_PHY_AUTO; m_adv_params.secondary_phy = BLE_GAP_PHY_AUTO; m_adv_params.scan_req_notification = 0; // Do not raise scan request notifications when scanned. @@ -606,12 +606,12 @@ bool ble_drv_advertise_data(ubluepy_advertise_data_t * p_adv_params) { #if (BLUETOOTH_SD == 110) if ((err_code = sd_ble_gap_adv_data_set(adv_data, byte_pos, NULL, 0)) != 0) { mp_raise_msg_varg(&mp_type_OSError, - MP_ERROR_TEXT("Can not apply advertisment data. status: 0x" HEX2_FMT), (uint16_t)err_code); + MP_ERROR_TEXT("Can not apply advertisement data. status: 0x" HEX2_FMT), (uint16_t)err_code); } #else if ((err_code = sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &m_adv_params)) != 0) { mp_raise_msg_varg(&mp_type_OSError, - MP_ERROR_TEXT("Can not apply advertisment data. status: 0x" HEX2_FMT), (uint16_t)err_code); + MP_ERROR_TEXT("Can not apply advertisement data. status: 0x" HEX2_FMT), (uint16_t)err_code); } #endif BLE_DRIVER_LOG("Set Adv data size: " UINT_FMT "\n", byte_pos); @@ -626,7 +626,7 @@ bool ble_drv_advertise_data(ubluepy_advertise_data_t * p_adv_params) { #endif if (err_code != 0) { mp_raise_msg_varg(&mp_type_OSError, - MP_ERROR_TEXT("Can not start advertisment. status: 0x" HEX2_FMT), (uint16_t)err_code); + MP_ERROR_TEXT("Can not start advertisement. status: 0x" HEX2_FMT), (uint16_t)err_code); } m_adv_in_progress = true; @@ -641,12 +641,12 @@ void ble_drv_advertise_stop(void) { #if (BLUETOOTH_SD == 110) if ((err_code = sd_ble_gap_adv_stop()) != 0) { mp_raise_msg_varg(&mp_type_OSError, - MP_ERROR_TEXT("Can not stop advertisment. status: 0x" HEX2_FMT), (uint16_t)err_code); + MP_ERROR_TEXT("Can not stop advertisement. status: 0x" HEX2_FMT), (uint16_t)err_code); } #else if ((err_code = sd_ble_gap_adv_stop(m_adv_handle)) != 0) { mp_raise_msg_varg(&mp_type_OSError, - MP_ERROR_TEXT("Can not stop advertisment. status: 0x" HEX2_FMT), (uint16_t)err_code); + MP_ERROR_TEXT("Can not stop advertisement. status: 0x" HEX2_FMT), (uint16_t)err_code); } #endif } diff --git a/ports/nrf/drivers/ticker.c b/ports/nrf/drivers/ticker.c index 46cc783c48..c2fa31e7c2 100644 --- a/ports/nrf/drivers/ticker.c +++ b/ports/nrf/drivers/ticker.c @@ -137,7 +137,7 @@ int set_ticker_callback(uint32_t index, ticker_callback_ptr func, int32_t initia ticker->INTENCLR = masks[index]; ticker->TASKS_CAPTURE[index] = 1; uint32_t t = FastTicker->CC[index]; - // Need to make sure that set tick is aligned to lastest tick + // Need to make sure that set tick is aligned to latest tick // Use CC[3] as a reference, as that is always up-to-date. int32_t cc3 = FastTicker->CC[3]; int32_t delta = t+initial_delay_us-cc3; diff --git a/ports/nrf/examples/ubluepy_eddystone.py b/ports/nrf/examples/ubluepy_eddystone.py index 1ebb2364d5..96818d01c2 100644 --- a/ports/nrf/examples/ubluepy_eddystone.py +++ b/ports/nrf/examples/ubluepy_eddystone.py @@ -53,7 +53,7 @@ def generate_eddystone_adv_packet(url): constants.ad_types.AD_TYPE_SERVICE_DATA, service_data ) - # generate advertisment packet + # generate advertisement packet packet = bytearray([]) packet.extend(packet_flags) packet.extend(packet_uuid16) diff --git a/ports/nrf/examples/ubluepy_temp.py b/ports/nrf/examples/ubluepy_temp.py index f841849dee..79c32a9da3 100644 --- a/ports/nrf/examples/ubluepy_temp.py +++ b/ports/nrf/examples/ubluepy_temp.py @@ -42,7 +42,7 @@ def event_handler(id, handle, data): rtc.stop() # indicate 'disconnected' LED(1).off() - # restart advertisment + # restart advertisement periph.advertise(device_name="micr_temp", services=[serv_env_sense]) elif id == constants.EVT_GATTS_WRITE: diff --git a/ports/nrf/modules/machine/pin.c b/ports/nrf/modules/machine/pin.c index db5cc9cbb1..974074fc91 100644 --- a/ports/nrf/modules/machine/pin.c +++ b/ports/nrf/modules/machine/pin.c @@ -618,7 +618,7 @@ MP_DEFINE_CONST_OBJ_TYPE( /// x3 = machine.Pin.board.X3 /// x3_af = x3.af_list() /// -/// x3_af will now contain an array of PinAF objects which are availble on +/// x3_af will now contain an array of PinAF objects which are available on /// pin X3. /// /// For the pyboard, x3_af would contain: diff --git a/ports/nrf/modules/machine/timer.c b/ports/nrf/modules/machine/timer.c index f6a0e54463..fbef0b0ef6 100644 --- a/ports/nrf/modules/machine/timer.c +++ b/ports/nrf/modules/machine/timer.c @@ -135,7 +135,7 @@ STATIC mp_obj_t machine_timer_make_new(const mp_obj_type_t *type, size_t n_args, } // Timer peripheral usage: - // Every timer instance has a numer of capture/compare (CC) registers. + // Every timer instance has a number of capture/compare (CC) registers. // These can store either the value to compare against (to trigger an // interrupt or a shortcut) or store a value returned from a // capture/compare event. diff --git a/ports/nrf/modules/ubluepy/modubluepy.h b/ports/nrf/modules/ubluepy/modubluepy.h index fbd07b8b9b..8f580acd0d 100644 --- a/ports/nrf/modules/ubluepy/modubluepy.h +++ b/ports/nrf/modules/ubluepy/modubluepy.h @@ -29,7 +29,7 @@ /* Examples: -Advertisment: +Advertisement: from ubluepy import Peripheral p = Peripheral() diff --git a/ports/nrf/modules/ubluepy/ubluepy_peripheral.c b/ports/nrf/modules/ubluepy/ubluepy_peripheral.c index d2a9e0011d..7de9aa26bb 100644 --- a/ports/nrf/modules/ubluepy/ubluepy_peripheral.c +++ b/ports/nrf/modules/ubluepy/ubluepy_peripheral.c @@ -165,7 +165,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(ubluepy_peripheral_set_conn_handler_obj, periph #if MICROPY_PY_UBLUEPY_PERIPHERAL /// \method advertise(device_name, [service=[service1, service2, ...]], [data=bytearray], [connectable=True]) -/// Start advertising. Connectable advertisment type by default. +/// Start advertising. Connectable advertisement type by default. /// STATIC mp_obj_t peripheral_advertise(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { static const mp_arg_t allowed_args[] = { @@ -234,7 +234,7 @@ STATIC mp_obj_t peripheral_advertise(mp_uint_t n_args, const mp_obj_t *pos_args, STATIC MP_DEFINE_CONST_FUN_OBJ_KW(ubluepy_peripheral_advertise_obj, 0, peripheral_advertise); /// \method advertise_stop() -/// Stop advertisment if any onging advertisment. +/// Stop advertisement if any onging advertisement. /// STATIC mp_obj_t peripheral_advertise_stop(mp_obj_t self_in) { ubluepy_peripheral_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/ports/nrf/modules/ubluepy/ubluepy_scan_entry.c b/ports/nrf/modules/ubluepy/ubluepy_scan_entry.c index 2dd4f57860..626578360a 100644 --- a/ports/nrf/modules/ubluepy/ubluepy_scan_entry.c +++ b/ports/nrf/modules/ubluepy/ubluepy_scan_entry.c @@ -71,7 +71,7 @@ STATIC mp_obj_t scan_entry_get_rssi(mp_obj_t self_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(bluepy_scan_entry_get_rssi_obj, scan_entry_get_rssi); /// \method getScanData() -/// Return list of the scan data tupples (ad_type, description, value) +/// Return list of the scan data tuples (ad_type, description, value) /// STATIC mp_obj_t scan_entry_get_scan_data(mp_obj_t self_in) { ubluepy_scan_entry_obj_t * self = MP_OBJ_TO_PTR(self_in); diff --git a/ports/nrf/modules/uos/microbitfs.c b/ports/nrf/modules/uos/microbitfs.c index fb88d47cc9..f4c2d20a09 100644 --- a/ports/nrf/modules/uos/microbitfs.c +++ b/ports/nrf/modules/uos/microbitfs.c @@ -127,7 +127,7 @@ extern const mp_obj_type_t uos_mbfs_textio_type; // Page indexes count down from the end of ROM. STATIC uint8_t first_page_index; STATIC uint8_t last_page_index; -// The number of useable chunks in the file system. +// The number of usable chunks in the file system. STATIC uint8_t chunks_in_file_system; // Index of chunk to start searches. This is randomised to even out wear. STATIC uint8_t start_index; diff --git a/ports/powerpc/head.S b/ports/powerpc/head.S index 09aa62e59c..f221114c7f 100644 --- a/ports/powerpc/head.S +++ b/ports/powerpc/head.S @@ -58,7 +58,7 @@ _start: b boot_entry -/* QEMU comes in at 0x10. Put a value in argc/r3 to distingush from +/* QEMU comes in at 0x10. Put a value in argc/r3 to distinguish from * microwatt. */ . = 0x10 FIXUP_ENDIAN diff --git a/ports/powerpc/powerpc.lds b/ports/powerpc/powerpc.lds index 93bd8a605c..545fa33011 100644 --- a/ports/powerpc/powerpc.lds +++ b/ports/powerpc/powerpc.lds @@ -6,7 +6,7 @@ SECTIONS KEEP(*(.head)) } - /* Put this at 0x1700 which is right after our execption + /* Put this at 0x1700 which is right after our exception * vectors in head.S. */ . = 0x1700; diff --git a/ports/rp2/boards/SPARKFUN_THINGPLUS/mpconfigboard.h b/ports/rp2/boards/SPARKFUN_THINGPLUS/mpconfigboard.h index c2ca90b968..7b5ced5de0 100644 --- a/ports/rp2/boards/SPARKFUN_THINGPLUS/mpconfigboard.h +++ b/ports/rp2/boards/SPARKFUN_THINGPLUS/mpconfigboard.h @@ -14,7 +14,7 @@ #define MICROPY_HW_SPI1_MOSI (15) #define MICROPY_HW_SPI1_MISO (12) -// Battery fuel guage MAX17048 on I2C1 +// Battery fuel gauge MAX17048 on I2C1 // BATT_ALERT GPIO24 // NeoPixel data GPIO8, power not toggleable diff --git a/ports/rp2/boards/make-pins.py b/ports/rp2/boards/make-pins.py index 55e7ebe01f..da575cf821 100755 --- a/ports/rp2/boards/make-pins.py +++ b/ports/rp2/boards/make-pins.py @@ -24,7 +24,7 @@ SUPPORTED_FN = { def parse_pin(name_str): """Parses a string and returns a pin number.""" if len(name_str) < 2: - raise ValueError("Expecting pin name to be at least 2 charcters.") + raise ValueError("Expecting pin name to be at least 2 characters.") if not name_str.startswith("GPIO") and not name_str.startswith("EXT_GPIO"): raise ValueError("Expecting pin name to start with EXT_/GPIO") return int(re.findall(r"\d+$", name_str)[0]) diff --git a/ports/rp2/memmap_mp.ld b/ports/rp2/memmap_mp.ld index 9db74ce9c9..0ed9509b82 100644 --- a/ports/rp2/memmap_mp.ld +++ b/ports/rp2/memmap_mp.ld @@ -68,7 +68,7 @@ SECTIONS /* bit of a hack right now to exclude all floating point and time critical (e.g. memset, memcpy) code from * FLASH ... we will include any thing excluded here in .data below by default */ *(.init) - /* Change for MicroPython... excluse gc.c, parse.c, vm.c from flash */ + /* Change for MicroPython... exclude gc.c, parse.c, vm.c from flash */ *(EXCLUDE_FILE(*libgcc.a: *libc.a: *lib_a-mem*.o *libm.a: *gc.c.obj *vm.c.obj *parse.c.obj) .text*) *(.fini) /* Pull all c'tors into .text */ diff --git a/ports/rp2/mpthreadport.c b/ports/rp2/mpthreadport.c index 252f7b01fa..33dc698305 100644 --- a/ports/rp2/mpthreadport.c +++ b/ports/rp2/mpthreadport.c @@ -36,7 +36,7 @@ extern uint8_t __StackTop, __StackBottom; void *core_state[2]; -// This will be non-NULL while Python code is execting. +// This will be non-NULL while Python code is executing. STATIC void *(*core1_entry)(void *) = NULL; STATIC void *core1_arg = NULL; diff --git a/ports/samd/machine_adc.c b/ports/samd/machine_adc.c index d407882529..8f47fc6d15 100644 --- a/ports/samd/machine_adc.c +++ b/ports/samd/machine_adc.c @@ -113,7 +113,7 @@ STATIC mp_obj_t adc_obj_make_new(const mp_obj_type_t *type, size_t n_args, size_ mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - // Unpack and check, whther the pin has ADC capability + // Unpack and check, whether the pin has ADC capability int id = mp_hal_get_pin_obj(args[ARG_id].u_obj); adc_config_t adc_config = get_adc_config(id, busy_flags); diff --git a/ports/samd/machine_i2c.c b/ports/samd/machine_i2c.c index 76d24674f0..330fa433d9 100644 --- a/ports/samd/machine_i2c.c +++ b/ports/samd/machine_i2c.c @@ -98,7 +98,7 @@ void common_i2c_irq_handler(int i2c_id) { i2c->I2CM.INTFLAG.reg |= SERCOM_I2CM_INTFLAG_SB; } } else if (IRQ_DATA_SENT) { - if (NACK_RECVD) { // e.g. NACK after adress for both read and write. + if (NACK_RECVD) { // e.g. NACK after address for both read and write. self->state = state_nack; // force stop of transmission i2c->I2CM.INTFLAG.reg |= SERCOM_I2CM_INTFLAG_MB; } else if (self->len > 0) { // data to be sent @@ -200,7 +200,7 @@ mp_obj_t machine_i2c_make_new(const mp_obj_type_t *type, size_t n_args, size_t n #elif defined(MCU_SAMD51) NVIC_EnableIRQ(SERCOM0_0_IRQn + 4 * self->id); // MB interrupt NVIC_EnableIRQ(SERCOM0_0_IRQn + 4 * self->id + 1); // SB interrupt - NVIC_EnableIRQ(SERCOM0_0_IRQn + 4 * self->id + 3); // ERRROR interrupt + NVIC_EnableIRQ(SERCOM0_0_IRQn + 4 * self->id + 3); // ERROR interrupt #endif // Now enable I2C. @@ -230,7 +230,7 @@ STATIC int machine_i2c_transfer_single(mp_obj_base_t *self_in, uint16_t addr, si i2c->I2CM.INTENSET.reg = SERCOM_I2CM_INTENSET_MB | SERCOM_I2CM_INTENSET_SB | SERCOM_I2CM_INTENSET_ERROR; self->state = state_busy; - // Send the adress, which kicks off the transfer + // Send the address, which kicks off the transfer i2c->I2CM.ADDR.bit.ADDR = (addr << 1) | READ_MODE; // Transfer the data diff --git a/ports/samd/machine_uart.c b/ports/samd/machine_uart.c index 7917529fb9..ec1b42de9e 100644 --- a/ports/samd/machine_uart.c +++ b/ports/samd/machine_uart.c @@ -507,7 +507,7 @@ STATIC mp_uint_t machine_uart_ioctl(mp_obj_t self_in, mp_uint_t request, mp_uint } } else if (request == MP_STREAM_FLUSH) { // The timeout is defined by the buffer size and the baudrate. - // Take the worst case assumtions at 13 bit symbol size times 2. + // Take the worst case assumptions at 13 bit symbol size times 2. uint64_t timeout = mp_hal_ticks_ms_64() + (3 #if MICROPY_HW_UART_TXBUF + self->write_buffer.size diff --git a/ports/samd/mcu/samd21/clock_config.c b/ports/samd/mcu/samd21/clock_config.c index d3c8c71995..4c05dd7cc7 100644 --- a/ports/samd/mcu/samd21/clock_config.c +++ b/ports/samd/mcu/samd21/clock_config.c @@ -125,14 +125,14 @@ void check_usb_recovery_mode(void) { // Purpose of the #defines for the clock configuration. // -// Both CPU and periperal devices are clocked by the DFLL48M clock. +// Both CPU and peripheral devices are clocked by the DFLL48M clock. // DFLL48M is either free running, or controlled by the 32kHz crystal, or // Synchronized with the USB clock. // // #define MICROPY_HW_XOSC32K (0 | 1) // // If MICROPY_HW_XOSC32K = 1, the 32kHz crystal is used as input for GCLK 1, which -// serves as refernce clock source for the DFLL48M oscillator, +// serves as reference clock source for the DFLL48M oscillator, // The crystal is used, unless MICROPY_HW_MCU_OSC32KULP is set. // In that case GCLK1 (and the CPU clock) is driven by the 32K Low power oscillator. // The reason for offering this option is a design flaw of the Adafruit @@ -147,11 +147,11 @@ void check_usb_recovery_mode(void) { // not exactly 48Mhz and has a substantional temperature drift. // // If MICROPY_HW_DFLL_USB_SYNC = 1, the DFLL48 is synchronized with the 1 kHz USB sync -// signal. If after boot there is no USB sync withing 500ms, the configuratuion falls +// signal. If after boot there is no USB sync within 500ms, the configuration falls // back to a free running 48Mhz oscillator. // // In all modes, the 48MHz signal has a substantial jitter, largest when -// MICROPY_HW_DFLL_USB_SYNC is active. That is caused by the repective +// MICROPY_HW_DFLL_USB_SYNC is active. That is caused by the respective // reference frequencies of 32kHz or 1 kHz being low. That affects most // PWM. Std Dev at 1kHz 0.156Hz (w. Crystal) up to 0.4 Hz (with USB sync). // @@ -171,7 +171,7 @@ void init_clocks(uint32_t cpu_freq) { // GCLK5: 48MHz, source: DFLL48M, usage: USB // GCLK8: 1kHz, source: XOSC32K or OSCULP32K, usage: WDT and RTC // DFLL48M: Reference sources: - // - in closed loop mode: eiter XOSC32K or OSCULP32K or USB clock + // - in closed loop mode: either XOSC32K or OSCULP32K or USB clock // from GCLK4. // - in open loop mode: None // FDPLL96M: Reference source GCLK1 diff --git a/ports/samd/mcu/samd21/pin-af-table.csv b/ports/samd/mcu/samd21/pin-af-table.csv index 6445d148b8..b74db0c8ef 100644 --- a/ports/samd/mcu/samd21/pin-af-table.csv +++ b/ports/samd/mcu/samd21/pin-af-table.csv @@ -2,7 +2,7 @@ # for some of the peripheral devices with many possible assignments. # The pin_cap_table is a subset from table 7-1 of the data sheet. # It contain the information about pin mux set and pad -# The eic and adc columns contain the decimal numer for the respecitive +# The eic and adc columns contain the decimal number for the respecitive # quantity, the columns for sercom, tc and tcc have in each cell # the device number in the upper nibble, and the pad number in the lower # nibble. If a signal is not available, the cell in the csv table is left empty. diff --git a/ports/samd/mcu/samd51/clock_config.c b/ports/samd/mcu/samd51/clock_config.c index 5cf543252e..50912b77ed 100644 --- a/ports/samd/mcu/samd51/clock_config.c +++ b/ports/samd/mcu/samd51/clock_config.c @@ -172,11 +172,11 @@ void check_usb_recovery_mode(void) { // not exactly 48Mhz and has a substantional temperature drift. // // If MICROPY_HW_DFLL_USB_SYNC = 1, the DFLL48 is synchronized with the 1 kHz USB sync -// signal. If after boot there is no USB sync withing 500ms, the configuratuion falls +// signal. If after boot there is no USB sync within 500ms, the configuration falls // back to a free running 48Mhz oscillator. // // In all modes, the 48MHz signal has a substantial jitter, largest when -// MICROPY_HW_DFLL_USB_SYNC is active. That is caused by the repective +// MICROPY_HW_DFLL_USB_SYNC is active. That is caused by the respective // reference frequencies of 32kHz or 1 kHz being low. That affects most // PWM. Std Dev at 1kHz 0.156Hz (w. Crystal) up to 0.4 Hz (with USB sync). // @@ -195,7 +195,7 @@ void init_clocks(uint32_t cpu_freq) { // GCLK4: 32kHz, source: XOSC32K, if crystal present, usage: DFLL48M reference // GCLK5: 48MHz, source: DFLL48M, usage: USB // DFLL48M: Reference sources: - // - in closed loop mode: eiter XOSC32K or OSCULP32K or USB clock + // - in closed loop mode: either XOSC32K or OSCULP32K or USB clock // - in open loop mode: None // DPLL0: 48 - 200 MHz diff --git a/ports/samd/mcu/samd51/pin-af-table.csv b/ports/samd/mcu/samd51/pin-af-table.csv index 70a009ba52..249ce6865c 100644 --- a/ports/samd/mcu/samd51/pin-af-table.csv +++ b/ports/samd/mcu/samd51/pin-af-table.csv @@ -1,9 +1,9 @@ # The pin_cap_table is a subset from table 6-1 of the data sheet. # It contain the information about pin mux set and pad # for some of the peripheral devices with many possible assignments. -# The colums represent the peripheral class, as defined in pin_cap_t. The +# The columns represent the peripheral class, as defined in pin_cap_t. The # column number is equivalent to the mux class. -# The eic and adc columns contain the decimal numer for the respecitive +# The eic and adc columns contain the decimal number for the respecitive # quantity, the columns for sercom, tc and tcc have in each cell # the device number in the first, and the pad number in the second # digit. If a signal is not available, the cell in the csv table is left empty. diff --git a/ports/samd/pin_af.c b/ports/samd/pin_af.c index d92a62b700..2664fd4109 100644 --- a/ports/samd/pin_af.c +++ b/ports/samd/pin_af.c @@ -121,7 +121,7 @@ const char *pin_name(int id) { return "-"; } -// Test, wether the given pin is defined and has signals for sercom. +// Test, whether the given pin is defined and has signals for sercom. // If that applies return the alt_fct and pad_nr. // If not, an error will be raised. @@ -136,7 +136,7 @@ sercom_pad_config_t get_sercom_config(int pin_id, uint8_t sercom_nr) { } } -// Test, wether the given pin is defined as ADC. +// Test, whether the given pin is defined as ADC. // If that applies return the adc instance and channel. // If not, an error will be raised. @@ -158,7 +158,7 @@ adc_config_t get_adc_config(int pin_id, int32_t flag) { } } -// Test, wether the given pin is defined and has signals for pwm. +// Test, whether the given pin is defined and has signals for pwm. // If that applies return the alt_fct, tcc number and channel number. // If not, an error will be raised. // The function either supplies a channel from a wanted device, or diff --git a/ports/stm32/boards/ARDUINO_GIGA/mpconfigboard.h b/ports/stm32/boards/ARDUINO_GIGA/mpconfigboard.h index cc38b0a7ca..dee0106b96 100644 --- a/ports/stm32/boards/ARDUINO_GIGA/mpconfigboard.h +++ b/ports/stm32/boards/ARDUINO_GIGA/mpconfigboard.h @@ -163,7 +163,7 @@ extern struct _spi_bdev_t spi_bdev; #define MICROPY_HW_UART7_RTS (pyb_pin_BT_RTS) #define MICROPY_HW_UART7_CTS (pyb_pin_BT_CTS) -// I2C busses +// I2C buses #define MICROPY_HW_I2C1_SCL (pyb_pin_I2C1_SCL) #define MICROPY_HW_I2C1_SDA (pyb_pin_I2C1_SDA) diff --git a/ports/stm32/boards/ARDUINO_NICLA_VISION/board_init.c b/ports/stm32/boards/ARDUINO_NICLA_VISION/board_init.c index 5ca495a606..ed8c609275 100644 --- a/ports/stm32/boards/ARDUINO_NICLA_VISION/board_init.c +++ b/ports/stm32/boards/ARDUINO_NICLA_VISION/board_init.c @@ -212,7 +212,7 @@ void NICLAV_board_low_power(int mode) { // Disable all power rails, except core voltage. NICLAV_board_pmic_enable(false); - // Reset all busses, peripherals, GPIO clocks etc.. + // Reset all buses, peripherals, GPIO clocks etc.. RCC->AHB1RSTR = 0x0A00C023U; RCC->AHB2RSTR = 0x00000271U; RCC->AHB3RSTR = 0x00015031U; diff --git a/ports/stm32/boards/ARDUINO_NICLA_VISION/mpconfigboard.h b/ports/stm32/boards/ARDUINO_NICLA_VISION/mpconfigboard.h index c47024b97d..e96d5b6a64 100644 --- a/ports/stm32/boards/ARDUINO_NICLA_VISION/mpconfigboard.h +++ b/ports/stm32/boards/ARDUINO_NICLA_VISION/mpconfigboard.h @@ -156,7 +156,7 @@ extern struct _spi_bdev_t spi_bdev; #define MICROPY_HW_LPUART1_TX (pin_A9) #define MICROPY_HW_LPUART1_RX (pin_A10) -// I2C busses +// I2C buses #define MICROPY_HW_I2C1_SCL (pin_B8) #define MICROPY_HW_I2C1_SDA (pin_B9) diff --git a/ports/stm32/boards/ARDUINO_PORTENTA_H7/mpconfigboard.h b/ports/stm32/boards/ARDUINO_PORTENTA_H7/mpconfigboard.h index 674154b316..529f4d6f2a 100644 --- a/ports/stm32/boards/ARDUINO_PORTENTA_H7/mpconfigboard.h +++ b/ports/stm32/boards/ARDUINO_PORTENTA_H7/mpconfigboard.h @@ -161,7 +161,7 @@ extern struct _spi_bdev_t spi_bdev; #define MICROPY_HW_UART7_RTS (pyb_pin_BT_RTS) #define MICROPY_HW_UART7_CTS (pyb_pin_BT_CTS) -// I2C busses +// I2C buses #define MICROPY_HW_I2C1_SCL (pin_B6) #define MICROPY_HW_I2C1_SDA (pin_B7) diff --git a/ports/stm32/boards/B_L475E_IOT01A/mpconfigboard.h b/ports/stm32/boards/B_L475E_IOT01A/mpconfigboard.h index b017edab99..69bedd2de7 100644 --- a/ports/stm32/boards/B_L475E_IOT01A/mpconfigboard.h +++ b/ports/stm32/boards/B_L475E_IOT01A/mpconfigboard.h @@ -20,7 +20,7 @@ // USART1 config connected to ST-Link #define MICROPY_HW_UART1_TX (pin_B6) #define MICROPY_HW_UART1_RX (pin_B7) -// USART2 config connected to PMOD: Flow control is defined and therfore used +// USART2 config connected to PMOD: Flow control is defined and therefore used #define MICROPY_HW_UART2_CTS (pin_D3) #define MICROPY_HW_UART2_RTS (pin_D4) #define MICROPY_HW_UART2_TX (pin_D5) diff --git a/ports/stm32/boards/LEGO_HUB_NO6/README.md b/ports/stm32/boards/LEGO_HUB_NO6/README.md index cc67b6a4bb..a80059d19a 100644 --- a/ports/stm32/boards/LEGO_HUB_NO6/README.md +++ b/ports/stm32/boards/LEGO_HUB_NO6/README.md @@ -24,7 +24,7 @@ The built-in bootloader has some drawbacks: it cannot be entered programmaticall and it does not keep the Hub powered up when running from battery (which requires keeping BAT_PWR_EN high). As such, this board is configured to work with mboot as a secondary bootloader: mboot is placed at 0x08008000 and the main application -firmware at 0x08010000. When mboot is installed it can be entered programatically +firmware at 0x08010000. When mboot is installed it can be entered programmatically via machine.bootloader(), or by holding down the left arrow button when powering on the Hub and waiting until the display says "B" before releasing the button. diff --git a/ports/stm32/boards/LEGO_HUB_NO6/appupdate.py b/ports/stm32/boards/LEGO_HUB_NO6/appupdate.py index 57b24d3f2e..02398e8124 100644 --- a/ports/stm32/boards/LEGO_HUB_NO6/appupdate.py +++ b/ports/stm32/boards/LEGO_HUB_NO6/appupdate.py @@ -1,4 +1,4 @@ -# Application firmware update funcion for LEGO_HUB_NO6. +# Application firmware update function for LEGO_HUB_NO6. # MIT license; Copyright (c) 2022 Damien P. George from micropython import const diff --git a/ports/stm32/boards/LEGO_HUB_NO6/mpconfigboard.h b/ports/stm32/boards/LEGO_HUB_NO6/mpconfigboard.h index 7f0b1fbe45..ffc53fa6fc 100644 --- a/ports/stm32/boards/LEGO_HUB_NO6/mpconfigboard.h +++ b/ports/stm32/boards/LEGO_HUB_NO6/mpconfigboard.h @@ -101,7 +101,7 @@ spi_bdev_ioctl(&spi_bdev, (op), (arg)) \ ) -// Configuration for stardard block protocol (block size FLASH_BLOCK_SIZE). +// Configuration for standard block protocol (block size FLASH_BLOCK_SIZE). #define MICROPY_HW_BDEV_READBLOCKS(dest, bl, n) \ spi_bdev_readblocks(&spi_bdev, (dest), MICROPY_HW_SPIFLASH_BLOCKMAP(bl), (n)) #define MICROPY_HW_BDEV_WRITEBLOCKS(src, bl, n) \ diff --git a/ports/stm32/boards/LEGO_HUB_NO7/README.md b/ports/stm32/boards/LEGO_HUB_NO7/README.md index 8159cf3f47..0cae109284 100644 --- a/ports/stm32/boards/LEGO_HUB_NO7/README.md +++ b/ports/stm32/boards/LEGO_HUB_NO7/README.md @@ -23,7 +23,7 @@ The built-in bootloader has some drawbacks: it cannot be entered programmaticall and it does not keep the Hub powered up when running from battery (which requires keeping BAT_PWR_EN high). As such, this board is configured to work with mboot as a secondary bootloader: mboot is placed at 0x08008000 and the main application -firmware at 0x08010000. When mboot is installed it can be entered programatically +firmware at 0x08010000. When mboot is installed it can be entered programmatically via machine.bootloader(). Backing up original Hub firmware diff --git a/ports/stm32/boards/LEGO_HUB_NO7/mpconfigboard.h b/ports/stm32/boards/LEGO_HUB_NO7/mpconfigboard.h index 50fb6c0607..3615225e51 100644 --- a/ports/stm32/boards/LEGO_HUB_NO7/mpconfigboard.h +++ b/ports/stm32/boards/LEGO_HUB_NO7/mpconfigboard.h @@ -82,7 +82,7 @@ spi_bdev_ioctl(&spi_bdev, (op), (arg)) \ ) -// Configuration for stardard block protocol (block size FLASH_BLOCK_SIZE). +// Configuration for standard block protocol (block size FLASH_BLOCK_SIZE). #define MICROPY_HW_BDEV_READBLOCKS(dest, bl, n) \ spi_bdev_readblocks(&spi_bdev, (dest), MICROPY_HW_SPIFLASH_BLOCKMAP(bl), (n)) #define MICROPY_HW_BDEV_WRITEBLOCKS(src, bl, n) \ diff --git a/ports/stm32/boards/LIMIFROG/board_init.c b/ports/stm32/boards/LIMIFROG/board_init.c index 1b4d9494fb..de9d65295a 100644 --- a/ports/stm32/boards/LIMIFROG/board_init.c +++ b/ports/stm32/boards/LIMIFROG/board_init.c @@ -59,7 +59,7 @@ static inline int IS_GPIO_RESET(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) { - The STM32 embeds in ROM a bootloader that allows to obtain code and boot from a number of different interfaces, - including USB in a mode called "DFU" (Device Frimware Update) + including USB in a mode called "DFU" (Device Firmware Update) [see AN3606 from ST for full details] This bootloader code is executed instead of the regular application code when pin BOOT0 is pulled-up (which on @@ -79,7 +79,7 @@ static inline int IS_GPIO_RESET(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) { other applicative code, of whether USB bootload is required (as flagged by a GPIO pulled low at reset, in the same way as BOOT0). The hadware reset pin of BLE is asserted (so that now it won't - generate any acitivity on UART3), and if USB bootload is required : + generate any activity on UART3), and if USB bootload is required : bootload ROM is remapped at address 0x0, stack pointer is updated and the code is branched to the start of the bootloader. - This code is run prior to any applicative configuration of clocks, diff --git a/ports/stm32/boards/common_ifs.ld b/ports/stm32/boards/common_ifs.ld index 1876e41561..33fa948bb7 100644 --- a/ports/stm32/boards/common_ifs.ld +++ b/ports/stm32/boards/common_ifs.ld @@ -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. So we pull in a couple of object files to pad it out. */ diff --git a/ports/stm32/boards/make-pins.py b/ports/stm32/boards/make-pins.py index 002a6f75f2..a3e6ee0669 100755 --- a/ports/stm32/boards/make-pins.py +++ b/ports/stm32/boards/make-pins.py @@ -80,7 +80,7 @@ CONDITIONAL_VAR = { def parse_port_pin(name_str): """Parses a string and returns a (port-num, pin-num) tuple.""" if len(name_str) < 3: - raise ValueError("Expecting pin name to be at least 3 charcters.") + raise ValueError("Expecting pin name to be at least 3 characters.") if name_str[0] != "P": raise ValueError("Expecting pin name to start with P") if name_str[1] < "A" or name_str[1] > "K": diff --git a/ports/stm32/eth.c b/ports/stm32/eth.c index 1207a728c3..0feacdae2d 100644 --- a/ports/stm32/eth.c +++ b/ports/stm32/eth.c @@ -307,7 +307,7 @@ STATIC int eth_mac_init(eth_t *self) { #endif #if defined(STM32H7) - // don't skip 32bit words since our desriptors are continuous in memory + // don't skip 32bit words since our descriptors are continuous in memory ETH->DMACCR &= ~(ETH_DMACCR_DSL_Msk); #endif diff --git a/ports/stm32/machine_spi.c b/ports/stm32/machine_spi.c index ddbd42bf29..c6d6015731 100644 --- a/ports/stm32/machine_spi.c +++ b/ports/stm32/machine_spi.c @@ -85,7 +85,7 @@ mp_obj_t machine_hard_spi_make_new(const mp_obj_type_t *type, size_t n_args, siz init->CRCCalculation = SPI_CRCCALCULATION_DISABLE; init->CRCPolynomial = 0; - // set configurable paramaters + // set configurable parameters spi_set_params(self->spi, 0xffffffff, args[ARG_baudrate].u_int, args[ARG_polarity].u_int, args[ARG_phase].u_int, args[ARG_bits].u_int, args[ARG_firstbit].u_int); diff --git a/ports/stm32/machine_uart.c b/ports/stm32/machine_uart.c index bb35bac5cc..20def373fb 100644 --- a/ports/stm32/machine_uart.c +++ b/ports/stm32/machine_uart.c @@ -644,7 +644,7 @@ STATIC mp_uint_t pyb_uart_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_t a ret |= MP_STREAM_POLL_WR; } } else if (request == MP_STREAM_FLUSH) { - // Since uart.write() waits up to the last byte, uart.flush() always succeds. + // Since uart.write() waits up to the last byte, uart.flush() always succeeds. ret = 0; } else { *errcode = MP_EINVAL; diff --git a/ports/stm32/mboot/README.md b/ports/stm32/mboot/README.md index 936b587608..73e32fcedc 100644 --- a/ports/stm32/mboot/README.md +++ b/ports/stm32/mboot/README.md @@ -225,7 +225,7 @@ In detail for PYBv1.0 (for PYBv1.1 use PYBV11 instead of PYBV10): $ make BOARD=PYBV10 USE_MBOOT=1 clean all deploy - MicroPython will now be on the device and should boot straightaway. + MicroPython will now be on the device and should boot straight away. On PYBv1.x without mboot the flash layout is as follows: diff --git a/ports/stm32/mboot/fwupdate.py b/ports/stm32/mboot/fwupdate.py index ba36b7965b..4bf07f5a33 100644 --- a/ports/stm32/mboot/fwupdate.py +++ b/ports/stm32/mboot/fwupdate.py @@ -252,7 +252,7 @@ def update_app_elements( _ELEM_TYPE_FSLOAD, struct.pack("bmRequest == 0x21) { // host-to-device request if (req->wLength == 0) { - // no data, process command straightaway + // no data, process command straight away dfu_handle_rx(self->bRequest, self->wValue, 0, NULL); } else { // have data, prepare to receive it @@ -1538,7 +1538,7 @@ void PendSV_Handler(void) { void SysTick_Handler(void) { systick_ms += 1; - // Read the systick control regster. This has the side effect of clearing + // Read the systick control register. This has the side effect of clearing // the COUNTFLAG bit, which makes the logic in mp_hal_ticks_us // work properly. SysTick->CTRL; diff --git a/ports/stm32/mboot/mboot.h b/ports/stm32/mboot/mboot.h index 2fce9a230d..2c48133327 100644 --- a/ports/stm32/mboot/mboot.h +++ b/ports/stm32/mboot/mboot.h @@ -82,7 +82,7 @@ #define MBOOT_ADDRESS_SPACE_64BIT (0) #endif -// These values are used in initial_r0 to enter mboot programatically. +// These values are used in initial_r0 to enter mboot programmatically. #define MBOOT_INITIAL_R0_KEY (0x70ad0000) #define MBOOT_INITIAL_R0_KEY_FSLOAD (MBOOT_INITIAL_R0_KEY | 0x80) diff --git a/ports/stm32/mboot/mboot_pack_dfu.py b/ports/stm32/mboot/mboot_pack_dfu.py index 683cdd0a71..0b2919a0c2 100644 --- a/ports/stm32/mboot/mboot_pack_dfu.py +++ b/ports/stm32/mboot/mboot_pack_dfu.py @@ -43,7 +43,7 @@ except ImportError: ) -# Currenty supported version of a packed DFU file. +# Currently supported version of a packed DFU file. MBOOT_PACK_HEADER_VERSION = 1 # Must match MBOOT_PACK_HYDRO_CONTEXT in mboot/pack.h diff --git a/ports/stm32/mboot/pack.h b/ports/stm32/mboot/pack.h index 3578d9d127..91f4896ccd 100644 --- a/ports/stm32/mboot/pack.h +++ b/ports/stm32/mboot/pack.h @@ -53,7 +53,7 @@ enum mboot_pack_chunk_format { MBOOT_PACK_CHUNK_FW_GZIP = 3, }; -// Each DFU chunk transfered has this header to validate it. +// Each DFU chunk transferred has this header to validate it. typedef struct _mboot_pack_chunk_buf_t { struct { diff --git a/ports/stm32/pendsv.c b/ports/stm32/pendsv.c index d4c4496f1b..9c908addb5 100644 --- a/ports/stm32/pendsv.c +++ b/ports/stm32/pendsv.c @@ -164,7 +164,7 @@ __attribute__((naked)) void PendSV_Handler(void) { "bl pyb_thread_next\n" // get next thread to execute "mov lr, r4\n" // restore lr "mov sp, r0\n" // switch stacks - "msr primask, r5\n" // reenable interrupts + "msr primask, r5\n" // re-enable interrupts "vpop {s16-s31}\n" "pop {r4-r11, lr}\n" "bx lr\n" // return from interrupt; will return to new thread diff --git a/ports/stm32/pin.c b/ports/stm32/pin.c index 8503f3dbe0..f2db0e20e8 100644 --- a/ports/stm32/pin.c +++ b/ports/stm32/pin.c @@ -613,7 +613,7 @@ MP_DEFINE_CONST_OBJ_TYPE( /// x3 = pyb.Pin.board.X3 /// x3_af = x3.af_list() /// -/// x3_af will now contain an array of PinAF objects which are availble on +/// x3_af will now contain an array of PinAF objects which are available on /// pin X3. /// /// For the pyboard, x3_af would contain: diff --git a/ports/stm32/powerctrl.c b/ports/stm32/powerctrl.c index 0ab80b487a..d5fa9095d8 100644 --- a/ports/stm32/powerctrl.c +++ b/ports/stm32/powerctrl.c @@ -382,7 +382,7 @@ STATIC uint32_t calc_apb2_div(uint32_t wanted_div) { #if defined(STM32F4) || defined(STM32F7) || defined(STM32G0) || defined(STM32G4) || defined(STM32H7) int powerctrl_set_sysclk(uint32_t sysclk, uint32_t ahb, uint32_t apb1, uint32_t apb2) { - // Return straightaway if the clocks are already at the desired frequency + // Return straight away if the clocks are already at the desired frequency if (sysclk == HAL_RCC_GetSysClockFreq() && ahb == HAL_RCC_GetHCLKFreq() && apb1 == HAL_RCC_GetPCLK1Freq() @@ -659,7 +659,7 @@ int powerctrl_set_sysclk(uint32_t sysclk, uint32_t ahb, uint32_t apb1, uint32_t powerctrl_config_systick(); } - // Return straightaway if the clocks are already at the desired frequency. + // Return straight away if the clocks are already at the desired frequency. if (ahb == HAL_RCC_GetHCLKFreq() && apb1 == HAL_RCC_GetPCLK1Freq() && apb2 == HAL_RCC_GetPCLK2Freq()) { diff --git a/ports/stm32/pyb_can.c b/ports/stm32/pyb_can.c index 69e807c79d..3c61405e7c 100644 --- a/ports/stm32/pyb_can.c +++ b/ports/stm32/pyb_can.c @@ -917,7 +917,7 @@ STATIC mp_obj_t pyb_can_setfilter(size_t n_args, const mp_obj_t *pos_args, mp_ma goto error; } } else { - if (filter.FilterNumber > 13) { // CAN3 is independant and has its own 14 filters. + if (filter.FilterNumber > 13) { // CAN3 is independent and has its own 14 filters. goto error; } } diff --git a/ports/stm32/pyb_i2c.c b/ports/stm32/pyb_i2c.c index 6bf04aa1b1..915eabe0b2 100644 --- a/ports/stm32/pyb_i2c.c +++ b/ports/stm32/pyb_i2c.c @@ -67,7 +67,7 @@ /// /// You can specify a timeout (in ms): /// -/// i2c.send(b'123', timeout=2000) # timout after 2 seconds +/// i2c.send(b'123', timeout=2000) # timeout after 2 seconds /// /// A controller must specify the recipient's address: /// diff --git a/ports/stm32/rfcore.c b/ports/stm32/rfcore.c index 2a75f7c74a..2e660d6d9e 100644 --- a/ports/stm32/rfcore.c +++ b/ports/stm32/rfcore.c @@ -451,7 +451,7 @@ STATIC size_t tl_check_msg(volatile tl_list_node_t *head, unsigned int ch, parse LL_C1_IPCC_ClearFlag_CHx(IPCC, ch); if (ch == IPCC_CH_BLE) { - // Renable IRQs for BLE now that we've cleared the flag. + // Re-enable IRQs for BLE now that we've cleared the flag. LL_C1_IPCC_EnableReceiveChannel(IPCC, IPCC_CH_BLE); } } diff --git a/ports/stm32/sdcard.c b/ports/stm32/sdcard.c index 964ed49a67..d09ee21d09 100644 --- a/ports/stm32/sdcard.c +++ b/ports/stm32/sdcard.c @@ -86,7 +86,7 @@ #endif // The F7 & L4 series calls the peripheral SDMMC rather than SDIO, so provide some -// #defines for backwards compatability. +// #defines for backwards compatibility. #define SDIO_CLOCK_EDGE_RISING SDMMC_CLOCK_EDGE_RISING #define SDIO_CLOCK_EDGE_FALLING SDMMC_CLOCK_EDGE_FALLING diff --git a/ports/stm32/sdram.c b/ports/stm32/sdram.c index fb0e5a8688..b0a3ef2157 100644 --- a/ports/stm32/sdram.c +++ b/ports/stm32/sdram.c @@ -346,7 +346,7 @@ bool __attribute__((optimize("Os"))) sdram_test(bool exhaustive) { } } - // Check for aliasing (overlaping addresses) + // Check for aliasing (overlapping addresses) mem_base[0] = antipattern; __DSB(); for (uint32_t i = 1; i < MICROPY_HW_SDRAM_SIZE; i <<= 1) { diff --git a/ports/stm32/system_stm32.c b/ports/stm32/system_stm32.c index 08f071cd27..de1897b4a6 100644 --- a/ports/stm32/system_stm32.c +++ b/ports/stm32/system_stm32.c @@ -190,7 +190,7 @@ MP_WEAK void SystemClock_Config(void) { #endif #if defined(STM32H7) - // Wait untill the voltage levels are valid. + // Wait until the voltage levels are valid. while (!__HAL_PWR_GET_FLAG(PWR_FLAG_ACTVOSRDY)) { } diff --git a/ports/stm32/systick.c b/ports/stm32/systick.c index 76944d312a..0fd7d3b8fb 100644 --- a/ports/stm32/systick.c +++ b/ports/stm32/systick.c @@ -43,7 +43,7 @@ void SysTick_Handler(void) { uint32_t uw_tick = uwTick + 1; uwTick = uw_tick; - // Read the systick control regster. This has the side effect of clearing + // Read the systick control register. This has the side effect of clearing // the COUNTFLAG bit, which makes the logic in mp_hal_ticks_us // work properly. SysTick->CTRL; diff --git a/ports/stm32/timer.c b/ports/stm32/timer.c index 8816c218f5..6c110f87ea 100644 --- a/ports/stm32/timer.c +++ b/ports/stm32/timer.c @@ -436,7 +436,7 @@ STATIC mp_obj_t compute_percent_from_pwm_value(uint32_t period, uint32_t cmp) { // Computes the 8-bit value for the DTG field in the BDTR register. // // 1 tick = 1 count of the timer's clock (source_freq) divided by div. -// 0-128 ticks in inrements of 1 +// 0-128 ticks in increments of 1 // 128-256 ticks in increments of 2 // 256-512 ticks in increments of 8 // 512-1008 ticks in increments of 16 @@ -554,7 +554,7 @@ STATIC void pyb_timer_print(const mp_print_t *print, mp_obj_t self_in, mp_print_ /// /// Keyword arguments: /// -/// - `freq` - specifies the periodic frequency of the timer. You migh also +/// - `freq` - specifies the periodic frequency of the timer. You might also /// view this as the frequency with which the timer goes through /// one complete cycle. /// @@ -1009,7 +1009,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_timer_deinit_obj, pyb_timer_deinit); /// If only a channel number is passed, then a previously initialized channel /// object is returned (or `None` if there is no previous channel). /// -/// Othwerwise, a TimerChannel object is initialized and returned. +/// Otherwise, a TimerChannel object is initialized and returned. /// /// Each channel can be configured to perform pwm, output compare, or /// input capture. All channels share the same underlying timer, which means @@ -1051,7 +1051,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_timer_deinit_obj, pyb_timer_deinit); /// /// - `polarity` can be one of: /// - `Timer.HIGH` - output is active high -/// - `Timer.LOW` - output is acive low +/// - `Timer.LOW` - output is active low /// /// Optional keyword arguments for Timer.IC modes: /// diff --git a/ports/stm32/usbd_cdc_interface.c b/ports/stm32/usbd_cdc_interface.c index 5432370a74..399411d8ab 100644 --- a/ports/stm32/usbd_cdc_interface.c +++ b/ports/stm32/usbd_cdc_interface.c @@ -357,7 +357,7 @@ int usbd_cdc_tx_flow(usbd_cdc_itf_t *cdc, const uint8_t *buf, uint32_t len) { } } -// timout in milliseconds. +// timeout in milliseconds. // Returns number of bytes written to the device. int usbd_cdc_tx(usbd_cdc_itf_t *cdc, const uint8_t *buf, uint32_t len, uint32_t timeout) { for (uint32_t i = 0; i < len; i++) { @@ -430,7 +430,7 @@ int usbd_cdc_rx_num(usbd_cdc_itf_t *cdc) { return rx_waiting; } -// timout in milliseconds. +// timeout in milliseconds. // Returns number of bytes read from the device. int usbd_cdc_rx(usbd_cdc_itf_t *cdc, uint8_t *buf, uint32_t len, uint32_t timeout) { // loop to read bytes diff --git a/ports/stm32/usbd_conf.c b/ports/stm32/usbd_conf.c index 3891d09ce1..a643c1eb6f 100644 --- a/ports/stm32/usbd_conf.c +++ b/ports/stm32/usbd_conf.c @@ -687,10 +687,10 @@ USBD_StatusTypeDef USBD_LL_PrepareReceive(USBD_HandleTypeDef *pdev, } /** - * @brief Returns the last transfered packet size. + * @brief Returns the last transferred packet size. * @param pdev: Device handle * @param ep_addr: Endpoint Number - * @retval Recived Data Size + * @retval Received Data Size */ uint32_t USBD_LL_GetRxDataSize(USBD_HandleTypeDef *pdev, uint8_t ep_addr) { return HAL_PCD_EP_GetRxCount(pdev->pData, ep_addr); diff --git a/ports/stm32/usbd_desc.c b/ports/stm32/usbd_desc.c index 3f6b74b800..db94fd2be8 100644 --- a/ports/stm32/usbd_desc.c +++ b/ports/stm32/usbd_desc.c @@ -8,7 +8,7 @@ * @author MCD Application Team * @version V1.0.1 * @date 26-February-2014 - * @brief This file provides the USBD descriptors and string formating method. + * @brief This file provides the USBD descriptors and string formatting method. ****************************************************************************** * @attention * @@ -129,7 +129,7 @@ STATIC uint8_t *USBD_StrDescriptor(USBD_HandleTypeDef *pdev, uint8_t idx, uint16 // the 96-bit unique ID, so for consistency we go with this algorithm. // You can see the serial number if you use: lsusb -v // - // See: https://my.st.com/52d187b7 for the algorithim used. + // See: https://my.st.com/52d187b7 for the algorithm used. uint8_t *id = (uint8_t *)MP_HAL_UNIQUE_ID_ADDRESS; snprintf(str_buf, sizeof(str_buf), diff --git a/ports/stm32/usbdev/class/src/usbd_cdc_msc_hid.c b/ports/stm32/usbdev/class/src/usbd_cdc_msc_hid.c index c32c20ab58..65d2fd70e5 100644 --- a/ports/stm32/usbdev/class/src/usbd_cdc_msc_hid.c +++ b/ports/stm32/usbdev/class/src/usbd_cdc_msc_hid.c @@ -204,7 +204,7 @@ static const uint8_t cdc_class_desc_data[CDC_CLASS_DESC_SIZE] = { 0x08, // bLength: 8 bytes USB_DESC_TYPE_ASSOCIATION, // bDescriptorType: IAD 0x00, // bFirstInterface: first interface for this association -- to be filled in - 0x02, // bInterfaceCount: nummber of interfaces for this association + 0x02, // bInterfaceCount: number of interfaces for this association 0x02, // bFunctionClass: Communication Interface Class 0x02, // bFunctionSubClass: Abstract Control Model 0x01, // bFunctionProtocol: Common AT commands diff --git a/ports/stm32/usbdev/class/src/usbd_msc_bot.c b/ports/stm32/usbdev/class/src/usbd_msc_bot.c index 44a74a6602..5bda0f8653 100644 --- a/ports/stm32/usbdev/class/src/usbd_msc_bot.c +++ b/ports/stm32/usbdev/class/src/usbd_msc_bot.c @@ -193,7 +193,7 @@ void MSC_BOT_DataIn (USBD_HandleTypeDef *pdev, } /** * @brief MSC_BOT_DataOut -* Proccess MSC OUT data +* Process MSC OUT data * @param pdev: device instance * @param epnum: endpoint index * @retval None diff --git a/ports/stm32/usbdev/core/src/usbd_core.c b/ports/stm32/usbdev/core/src/usbd_core.c index 4c69a77eb6..13a8faed31 100644 --- a/ports/stm32/usbdev/core/src/usbd_core.c +++ b/ports/stm32/usbdev/core/src/usbd_core.c @@ -88,7 +88,7 @@ #if 0 /** * @brief USBD_Init -* Initailizes the device stack and load the class driver +* Initializes the device stack and load the class driver * @param pdev: device instance * @param core_address: USB OTG core ID * @param pdesc: Descriptor structure address diff --git a/ports/teensy/core/mk20dx128.c b/ports/teensy/core/mk20dx128.c index 0f5f1e19e2..f79bf436f4 100644 --- a/ports/teensy/core/mk20dx128.c +++ b/ports/teensy/core/mk20dx128.c @@ -561,7 +561,7 @@ void ResetHandler(void) _init_Teensyduino_internal_(); if (RTC_SR & RTC_SR_TIF) { - // TODO: this should probably set the time more agressively, if + // TODO: this should probably set the time more aggressively, if // we could reliably detect the first reboot after programming. rtc_set(TIME_T); } diff --git a/ports/teensy/core/mk20dx128.h b/ports/teensy/core/mk20dx128.h index ab13760508..c6eda2837f 100644 --- a/ports/teensy/core/mk20dx128.h +++ b/ports/teensy/core/mk20dx128.h @@ -1018,7 +1018,7 @@ extern "C" { #define MCG_C6_VDIV0(n) (uint8_t)((n) & 0x1F) // VCO 0 Divider #define MCG_C6_CME0 (uint8_t)0x20 // Clock Monitor Enable #define MCG_C6_PLLS (uint8_t)0x40 // PLL Select, Controls whether the PLL or FLL output is selected as the MCG source when CLKS[1:0]=00. -#define MCG_C6_LOLIE0 (uint8_t)0x80 // Loss of Lock Interrrupt Enable +#define MCG_C6_LOLIE0 (uint8_t)0x80 // Loss of Lock Interrupt Enable #define MCG_S *(volatile uint8_t *)0x40064006 // MCG Status Register #define MCG_S_IRCST (uint8_t)0x01 // Internal Reference Clock Status #define MCG_S_OSCINIT0 (uint8_t)0x02 // OSC Initialization, resets to 0, is set to 1 after the initialization cycles of the crystal oscillator diff --git a/ports/teensy/core/usb_desc.c b/ports/teensy/core/usb_desc.c index 828a61967f..cc1103b9f0 100644 --- a/ports/teensy/core/usb_desc.c +++ b/ports/teensy/core/usb_desc.c @@ -799,9 +799,9 @@ const usb_descriptor_list_t usb_descriptor_list[] = { #if 0 // 0x00 = not used -// 0x19 = Recieve only +// 0x19 = Receive only // 0x15 = Transmit only -// 0x1D = Transmit & Recieve +// 0x1D = Transmit & Receive // const uint8_t usb_endpoint_config_table[NUM_ENDPOINTS] = { diff --git a/ports/teensy/core/usb_desc.h b/ports/teensy/core/usb_desc.h index a951e03f61..49ecf86aeb 100644 --- a/ports/teensy/core/usb_desc.h +++ b/ports/teensy/core/usb_desc.h @@ -69,7 +69,7 @@ automatically adapt to the changes you specify. If you need to create a new type of interface, you'll need to write the code which sends and receives packets, and presents an API to the user. -Finally, edit usb_inst.cpp, which creats instances of the C++ +Finally, edit usb_inst.cpp, which creates instances of the C++ objects for each combination. Some operating systems, especially Windows, may cache USB device diff --git a/ports/teensy/make-pins.py b/ports/teensy/make-pins.py index 4e46a8c244..844e2d8bc3 100755 --- a/ports/teensy/make-pins.py +++ b/ports/teensy/make-pins.py @@ -18,7 +18,7 @@ SUPPORTED_FN = { def parse_port_pin(name_str): """Parses a string and returns a (port-num, pin-num) tuple.""" if len(name_str) < 4: - raise ValueError("Expecting pin name to be at least 4 charcters.") + raise ValueError("Expecting pin name to be at least 4 characters.") if name_str[0:2] != "PT": raise ValueError("Expecting pin name to start with PT") if name_str[2] not in ("A", "B", "C", "D", "E", "Z"): diff --git a/ports/teensy/modpyb.c b/ports/teensy/modpyb.c index b48fecc18f..5dae8f73e5 100644 --- a/ports/teensy/modpyb.c +++ b/ports/teensy/modpyb.c @@ -165,7 +165,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_millis_obj, pyb_millis); /// Returns the number of milliseconds which have elapsed since `start`. /// /// This function takes care of counter wrap, and always returns a positive -/// number. This means it can be used to measure periods upto about 12.4 days. +/// number. This means it can be used to measure periods up to about 12.4 days. /// /// Example: /// start = pyb.millis() @@ -196,7 +196,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_micros_obj, pyb_micros); /// Returns the number of microseconds which have elapsed since `start`. /// /// This function takes care of counter wrap, and always returns a positive -/// number. This means it can be used to measure periods upto about 17.8 minutes. +/// number. This means it can be used to measure periods up to about 17.8 minutes. /// /// Example: /// start = pyb.micros() diff --git a/ports/teensy/timer.c b/ports/teensy/timer.c index 8c7609e447..56d25e3312 100644 --- a/ports/teensy/timer.c +++ b/ports/teensy/timer.c @@ -209,7 +209,7 @@ STATIC void pyb_timer_print(const mp_print_t *print, mp_obj_t self_in, mp_print_ /// /// Keyword arguments: /// -/// - `freq` - specifies the periodic frequency of the timer. You migh also +/// - `freq` - specifies the periodic frequency of the timer. You might also /// view this as the frequency with which the timer goes through /// one complete cycle. /// @@ -388,7 +388,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_timer_deinit_obj, pyb_timer_deinit); /// If only a channel number is passed, then a previously initialized channel /// object is returned (or `None` if there is no previous channel). /// -/// Othwerwise, a TimerChannel object is initialized and returned. +/// Otherwise, a TimerChannel object is initialized and returned. /// /// Each channel can be configured to perform pwm, output compare, or /// input capture. All channels share the same underlying timer, which means @@ -425,7 +425,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_timer_deinit_obj, pyb_timer_deinit); /// /// - `polarity` can be one of: /// - `Timer.HIGH` - output is active high -/// - `Timer.LOW` - output is acive low +/// - `Timer.LOW` - output is active low /// /// Optional keyword arguments for Timer.IC modes: /// diff --git a/ports/unix/coverage.c b/ports/unix/coverage.c index f545674cee..f059c21be4 100644 --- a/ports/unix/coverage.c +++ b/ports/unix/coverage.c @@ -539,7 +539,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_module_context_t context; mp_obj_fun_bc_t fun_bc; fun_bc.context = &context; diff --git a/ports/unix/main.c b/ports/unix/main.c index d6ae1e611b..95ed216e4b 100644 --- a/ports/unix/main.c +++ b/ports/unix/main.c @@ -414,7 +414,7 @@ STATIC void pre_process_options(int argc, char **argv) { #if MICROPY_PY_THREAD mp_thread_is_realtime_enabled = true; #endif - // main thread was already intialized before the option + // main thread was already initialized before the option // was parsed, so we have to enable realtime here. mp_thread_set_realtime(); #endif diff --git a/ports/unix/modtermios.c b/ports/unix/modtermios.c index 687bf1abf1..4f9751e274 100644 --- a/ports/unix/modtermios.c +++ b/ports/unix/modtermios.c @@ -75,7 +75,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; } diff --git a/ports/unix/variants/mpconfigvariant_common.h b/ports/unix/variants/mpconfigvariant_common.h index 072c4ca490..e4e0c0c5d3 100644 --- a/ports/unix/variants/mpconfigvariant_common.h +++ b/ports/unix/variants/mpconfigvariant_common.h @@ -41,7 +41,7 @@ #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE) #endif -// Enable arbritrary precision long-int by default. +// Enable arbitrary precision long-int by default. #ifndef MICROPY_LONGINT_IMPL #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ) #endif diff --git a/py/asmbase.c b/py/asmbase.c index da4273506a..cf64e3f3d0 100644 --- a/py/asmbase.c +++ b/py/asmbase.c @@ -80,7 +80,7 @@ uint8_t *mp_asm_base_get_cur_to_write_bytes(void *as_in, size_t num_bytes_to_wri void mp_asm_base_label_assign(mp_asm_base_t *as, size_t label) { assert(label < as->max_num_labels); - // Assiging a label ends any dead-code region, and all following machine + // Assigning a label ends any dead-code region, and all following machine // code should be emitted (until another mp_asm_base_suppress_code() call). as->suppress = false; diff --git a/py/asmthumb.c b/py/asmthumb.c index 49574c43a7..395134028a 100644 --- a/py/asmthumb.c +++ b/py/asmthumb.c @@ -290,7 +290,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 operations 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)) diff --git a/py/compile.c b/py/compile.c index 7a1660b1b2..c953711081 100644 --- a/py/compile.c +++ b/py/compile.c @@ -3493,7 +3493,7 @@ void mp_compile_to_raw_code(mp_parse_tree_t *parse_tree, qstr source_file, bool } } - // 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; } diff --git a/py/emitbc.c b/py/emitbc.c index 70a4d8b12e..a07657408f 100644 --- a/py/emitbc.c +++ b/py/emitbc.c @@ -439,7 +439,7 @@ void mp_emit_bc_set_source_line(emit_t *emit, mp_uint_t source_line) { } void mp_emit_bc_label_assign(emit_t *emit, mp_uint_t l) { - // Assiging a label ends any dead-code region, and all following opcodes + // Assigning a label ends any dead-code region, and all following opcodes // should be emitted (until another unconditional flow control). emit->suppress = false; diff --git a/py/emitnative.c b/py/emitnative.c index 3cb003315d..c6e6150099 100644 --- a/py/emitnative.c +++ b/py/emitnative.c @@ -894,7 +894,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]; diff --git a/py/formatfloat.c b/py/formatfloat.c index fc1b2fe7fc..050d3a9dfb 100644 --- a/py/formatfloat.c +++ b/py/formatfloat.c @@ -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. diff --git a/py/gc.c b/py/gc.c index ad3e110407..0873a0e11e 100644 --- a/py/gc.c +++ b/py/gc.c @@ -150,10 +150,10 @@ STATIC void gc_setup_area(mp_state_mem_area_t *area, void *start, void *end) { #endif #if MICROPY_ENABLE_FINALISER - // clear ATBs and FTBs + // clear ATB's and FTB's memset(area->gc_alloc_table_start, 0, gc_finaliser_table_byte_len + area->gc_alloc_table_byte_len + ALLOC_TABLE_GAP_BYTE); #else - // clear ATBs + // clear ATB's memset(area->gc_alloc_table_start, 0, area->gc_alloc_table_byte_len + ALLOC_TABLE_GAP_BYTE); #endif diff --git a/py/makecompresseddata.py b/py/makecompresseddata.py index 9603de8713..1bce3e8e83 100644 --- a/py/makecompresseddata.py +++ b/py/makecompresseddata.py @@ -24,7 +24,7 @@ def check_non_ascii(msg): # Replace with . -# Trival scheme to demo/test. +# Trivial scheme to demo/test. def space_compression(error_strings): for line in error_strings: check_non_ascii(line) diff --git a/py/mkrules.mk b/py/mkrules.mk index a58bd2ee0e..aa7f77bd2a 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -34,7 +34,7 @@ QSTR_GEN_CXXFLAGS += $(QSTR_GEN_FLAGS) # 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: # @@ -192,7 +192,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))) diff --git a/py/modbuiltins.c b/py/modbuiltins.c index 06e9f1acb5..da29e5b67d 100644 --- a/py/modbuiltins.c +++ b/py/modbuiltins.c @@ -79,7 +79,7 @@ STATIC mp_obj_t mp_builtin___build_class__(size_t n_args, const mp_obj_t *args) meta_args[2] = class_locals; // dict of members mp_obj_t new_class = mp_call_function_n_kw(meta, 3, 0, meta_args); - // store into cell if neede + // store into cell if needed if (cell != mp_const_none) { mp_obj_cell_set(cell, new_class); } diff --git a/py/objexcept.c b/py/objexcept.c index 515cbe7425..cc0ddd9dc5 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -217,7 +217,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 diff --git a/py/objtype.c b/py/objtype.c index 909fc83393..7f71968ea0 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -619,7 +619,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; } diff --git a/py/parse.c b/py/parse.c index 62de3282b3..c228d3a34a 100644 --- a/py/parse.c +++ b/py/parse.c @@ -553,7 +553,7 @@ STATIC mp_parse_node_t make_node_const_object(parser_t *parser, size_t src_line, return (mp_parse_node_t)pn; } -// Create a parse node represeting a constant object, possibly optimising the case of +// Create a parse node representing a constant object, possibly optimising the case of // an integer, by putting the (small) integer value directly in the parse node itself. STATIC mp_parse_node_t make_node_const_object_optimised(parser_t *parser, size_t src_line, mp_obj_t obj) { if (mp_obj_is_small_int(obj)) { @@ -1002,7 +1002,7 @@ STATIC void push_result_rule(parser_t *parser, size_t src_line, uint8_t rule_id, #if MICROPY_COMP_CONST_TUPLE if (build_tuple(parser, src_line, rule_id, num_args)) { - // we built a tuple from this rule so return straightaway + // we built a tuple from this rule so return straight away return; } #endif diff --git a/py/runtime.c b/py/runtime.c index 23fae6041d..3c7c0350c1 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -450,7 +450,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; } diff --git a/py/scope.h b/py/scope.h index b781dde427..e7d2a304f7 100644 --- a/py/scope.h +++ b/py/scope.h @@ -50,7 +50,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; diff --git a/py/sequence.c b/py/sequence.c index fa660a3384..5838607431 100644 --- a/py/sequence.c +++ b/py/sequence.c @@ -156,7 +156,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; diff --git a/shared/netutils/dhcpserver.c b/shared/netutils/dhcpserver.c index ea5718d114..50cd69a1eb 100644 --- a/shared/netutils/dhcpserver.c +++ b/shared/netutils/dhcpserver.c @@ -277,8 +277,8 @@ static void dhcp_server_process(void *arg, struct udp_pcb *upcb, struct pbuf *p, opt_write_n(&opt, DHCP_OPT_SERVER_ID, 4, &d->ip.addr); opt_write_n(&opt, DHCP_OPT_SUBNET_MASK, 4, &d->nm.addr); - opt_write_n(&opt, DHCP_OPT_ROUTER, 4, &d->ip.addr); // aka gateway; can have mulitple addresses - opt_write_u32(&opt, DHCP_OPT_DNS, DEFAULT_DNS); // can have mulitple addresses + opt_write_n(&opt, DHCP_OPT_ROUTER, 4, &d->ip.addr); // aka gateway; can have multiple addresses + opt_write_u32(&opt, DHCP_OPT_DNS, DEFAULT_DNS); // can have multiple addresses opt_write_u32(&opt, DHCP_OPT_IP_LEASE_TIME, DEFAULT_LEASE_TIME_S); *opt++ = DHCP_OPT_END; dhcp_socket_sendto(&d->udp, &dhcp_msg, opt - (uint8_t *)&dhcp_msg, 0xffffffff, PORT_DHCP_CLIENT); diff --git a/shared/runtime/pyexec.c b/shared/runtime/pyexec.c index ec0ff87f1d..e32150e5e7 100644 --- a/shared/runtime/pyexec.c +++ b/shared/runtime/pyexec.c @@ -592,7 +592,7 @@ friendly_repl_reset: // If the user gets to here and interrupts are disabled then // they'll never see the prompt, traceback etc. The USB REPL needs // interrupts to be enabled or no transfers occur. So we try to - // do the user a favor and reenable interrupts. + // do the user a favor and re-enable interrupts. if (query_irq() == IRQ_STATE_DISABLED) { enable_irq(IRQ_STATE_ENABLED); mp_hal_stdout_tx_str("MPY: enabling IRQs\r\n"); diff --git a/shared/runtime/softtimer.c b/shared/runtime/softtimer.c index 68173ac337..267610b269 100644 --- a/shared/runtime/softtimer.c +++ b/shared/runtime/softtimer.c @@ -41,7 +41,7 @@ STATIC soft_timer_entry_t *soft_timer_heap; static inline int32_t ticks_diff(uint32_t t1, uint32_t t0) { // t1 is after t0 (i.e. positive result) if there exists a uint32_t X <= INT_MAX - // such that t0 + X = t1. Otherwise t1 is interepreted to be earlier than + // such that t0 + X = t1. Otherwise t1 is interpreted to be earlier than // t0 (negative result). return t1 - t0; } diff --git a/shared/tinyusb/mp_usbd.c b/shared/tinyusb/mp_usbd.c index 0edc489881..ea1de674bc 100644 --- a/shared/tinyusb/mp_usbd.c +++ b/shared/tinyusb/mp_usbd.c @@ -31,7 +31,7 @@ #if MICROPY_HW_ENABLE_USBDEV #ifndef NO_QSTR -#include "tusb.h" // TinyUSB is not avaiable when running the string preprocessor +#include "tusb.h" // TinyUSB is not available when running the string preprocessor #include "device/usbd.h" #include "device/usbd_pvt.h" #endif diff --git a/shared/upytesthelper/upytesthelper.c b/shared/upytesthelper/upytesthelper.c index ce60732424..9553ff468e 100644 --- a/shared/upytesthelper/upytesthelper.c +++ b/shared/upytesthelper/upytesthelper.c @@ -60,7 +60,7 @@ bool upytest_is_failed(void) { } // MP_PLAT_PRINT_STRN() should be redirected to this function. -// It will pass-thru any content to mp_hal_stdout_tx_strn_cooked() +// It will pass-through any content to mp_hal_stdout_tx_strn_cooked() // (the dfault value of MP_PLAT_PRINT_STRN), but will also match // it to the expected output as set by upytest_set_expected_output(). // If mismatch happens, upytest_is_failed() returns true. diff --git a/tests/basics/annotate_var.py b/tests/basics/annotate_var.py index 3f767e4a73..a359b229b1 100644 --- a/tests/basics/annotate_var.py +++ b/tests/basics/annotate_var.py @@ -1,4 +1,4 @@ -# test PEP 526, varible annotations +# test PEP 526, variable annotations x: int print("x" in globals()) diff --git a/tests/basics/int_big1.py b/tests/basics/int_big1.py index 108e3ee5c9..5b35e3db4a 100644 --- a/tests/basics/int_big1.py +++ b/tests/basics/int_big1.py @@ -1,4 +1,4 @@ -# to test arbitrariy precision integers +# to test arbitrary precision integers x = 1000000000000000000000000000000 xn = -1000000000000000000000000000000 diff --git a/tests/basics/struct1.py b/tests/basics/struct1.py index db34342a17..c4960d2f80 100644 --- a/tests/basics/struct1.py +++ b/tests/basics/struct1.py @@ -57,7 +57,7 @@ try: except: print("Unknown type") -# Initially repitition counters were supported only for strings, +# Initially repetition counters were supported only for strings, # but later were implemented for all. print(struct.unpack("<3B2h", b"foo\x12\x34\xff\xff")) print(struct.pack("<3B", 1, 2, 3)) diff --git a/tests/basics/with_return.py b/tests/basics/with_return.py index fd848f1331..f2083d2aec 100644 --- a/tests/basics/with_return.py +++ b/tests/basics/with_return.py @@ -30,7 +30,7 @@ def f(): return (i, j) print(f()) -# multiple for loops within nested withs +# multiple for loops within nested with's def f(): with CtxMgr(1): for i in [1, 2]: @@ -41,7 +41,7 @@ def f(): return (i, j, k, l) print(f()) -# multiple for loops that are optimised, and nested withs +# multiple for loops that are optimised, and nested with's def f(): with CtxMgr(1): for i in range(1, 3): diff --git a/tests/cpydiff/core_fstring_repr.py b/tests/cpydiff/core_fstring_repr.py index fcadcbf1b9..df80abf795 100644 --- a/tests/cpydiff/core_fstring_repr.py +++ b/tests/cpydiff/core_fstring_repr.py @@ -2,7 +2,7 @@ categories: Core description: f-strings don't support the !r, !s, and !a conversions cause: MicroPython is optimised for code space. -workaround: Use repr(), str(), and ascii() explictly. +workaround: Use repr(), str(), and ascii() explicitly. """ diff --git a/tests/cpydiff/core_import_path.py b/tests/cpydiff/core_import_path.py index 04fc4bd5bb..959fd571f5 100644 --- a/tests/cpydiff/core_import_path.py +++ b/tests/cpydiff/core_import_path.py @@ -1,7 +1,7 @@ """ categories: Core,import description: __path__ attribute of a package has a different type (single string instead of list of strings) in MicroPython -cause: MicroPython does't support namespace packages split across filesystem. Beyond that, MicroPython's import system is highly optimized for minimal memory usage. +cause: MicroPython doesn't support namespace packages split across filesystem. Beyond that, MicroPython's import system is highly optimized for minimal memory usage. workaround: Details of import handling is inherently implementation dependent. Don't rely on such details in portable applications. """ import modules diff --git a/tests/cpydiff/core_import_split_ns_pkgs.py b/tests/cpydiff/core_import_split_ns_pkgs.py index 62bf337a22..5c92b63124 100644 --- a/tests/cpydiff/core_import_split_ns_pkgs.py +++ b/tests/cpydiff/core_import_split_ns_pkgs.py @@ -1,6 +1,6 @@ """ categories: Core,import -description: MicroPython does't support namespace packages split across filesystem. +description: MicroPython doesn't support namespace packages split across filesystem. cause: MicroPython's import system is highly optimized for simplicity, minimal memory usage, and minimal filesystem search overhead. workaround: Don't install modules belonging to the same namespace package in different directories. For MicroPython, it's recommended to have at most 3-component module search paths: for your current application, per-user (writable), system-wide (non-writable). """ diff --git a/tests/extmod/framebuf_palette.py b/tests/extmod/framebuf_palette.py index 84db834c15..f5b15fda73 100644 --- a/tests/extmod/framebuf_palette.py +++ b/tests/extmod/framebuf_palette.py @@ -30,6 +30,6 @@ fbd.blit(fbc, 0, 0, -1, palette) print(fbd.pixel(0, 0) == fg) print(fbd.pixel(7, 7) == fg) -print(fbd.pixel(8, 8) == 0) # Ouside blit +print(fbd.pixel(8, 8) == 0) # Outside blit print(fbd.pixel(0, 1) == bg) print(fbd.pixel(1, 0) == bg) diff --git a/tests/extmod/uctypes_sizeof_layout.py b/tests/extmod/uctypes_sizeof_layout.py index 2108e81502..c710ecde95 100644 --- a/tests/extmod/uctypes_sizeof_layout.py +++ b/tests/extmod/uctypes_sizeof_layout.py @@ -13,7 +13,7 @@ desc = { # uctypes.NATIVE is default print(uctypes.sizeof(desc) == uctypes.sizeof(desc, uctypes.NATIVE)) -# Here we assume that that we run on a platform with convential ABI +# Here we assume that that we run on a platform with conventional ABI # (which rounds up structure size based on max alignment). For platforms # where that doesn't hold, this tests should be just disabled in the runner. print(uctypes.sizeof(desc, uctypes.NATIVE) > uctypes.sizeof(desc, uctypes.LITTLE_ENDIAN)) diff --git a/tests/extmod/utimeq1.py b/tests/extmod/utimeq1.py index ddbc969afb..688e5b834f 100644 --- a/tests/extmod/utimeq1.py +++ b/tests/extmod/utimeq1.py @@ -125,7 +125,7 @@ assert edge_case(MODULO_HALF - 1, -100) == diff # We expect diff to be always positive, per the definition of heappop() which should return # the smallest value. -# This is the edge case where this invariant breaks, due to assymetry of two's-complement +# This is the edge case where this invariant breaks, due to asymmetry of two's-complement # range - there's one more negative integer than positive, so heappushing values like below # will then make ticks_diff() return the minimum negative value. We could make heappop # return them in a different order, but ticks_diff() result would be the same. Conclusion: diff --git a/tests/feature_check/README b/tests/feature_check/README index 3b7b6cba41..3f4804cfc9 100644 --- a/tests/feature_check/README +++ b/tests/feature_check/README @@ -1,4 +1,4 @@ This directory doesn't contain real tests, but code snippets to detect -various interpreter features, which can't be/inconvenient to detecte by +various interpreter features, which can't be/inconvenient to detect by other means. Scripts here are executed by run-tests.py at the beginning of testsuite to decide what other test groups to run/exclude. diff --git a/tests/misc/non_compliant.py b/tests/misc/non_compliant.py index 0839274462..cc63185b5d 100644 --- a/tests/misc/non_compliant.py +++ b/tests/misc/non_compliant.py @@ -39,7 +39,7 @@ try: except NotImplementedError: print("NotImplementedError") -# uPy raises TypeError, shold be ValueError +# uPy raises TypeError, should be ValueError try: "%c" % b"\x01\x02" except (TypeError, ValueError): diff --git a/tests/net_hosted/README b/tests/net_hosted/README index 709ed50ce3..887e430e29 100644 --- a/tests/net_hosted/README +++ b/tests/net_hosted/README @@ -6,6 +6,6 @@ Note that setup for these tests and tests themselves are WIP, and may not yet fully correspond to the functional specification above. So far, these tests are not run as part of the main testsuite and need -to be run seperately (from the main test/ directory): +to be run separately (from the main test/ directory): ./run-tests.py net_hosted/*.py diff --git a/tests/net_inet/README b/tests/net_inet/README index 1d6e15b174..e5e05845f8 100644 --- a/tests/net_inet/README +++ b/tests/net_inet/README @@ -1,5 +1,5 @@ This directory contains network tests which require Internet connection. Note that these tests are not run as part of the main testsuite and need -to be run seperately (from the main test/ directory): +to be run separately (from the main test/ directory): ./run-tests.py net_inet/*.py diff --git a/tests/thread/thread_lock1.py b/tests/thread/thread_lock1.py index 342c554f4a..1d0701da01 100644 --- a/tests/thread/thread_lock1.py +++ b/tests/thread/thread_lock1.py @@ -30,7 +30,7 @@ print(lock.locked()) with lock: print(lock.locked()) -# test that lock is unlocked if an error is rasied +# test that lock is unlocked if an error is raised try: with lock: print(lock.locked()) diff --git a/tests/wipy/uart.py b/tests/wipy/uart.py index 9498d95545..94ac9051b2 100644 --- a/tests/wipy/uart.py +++ b/tests/wipy/uart.py @@ -156,7 +156,7 @@ except Exception: for uart_id in uart_id_range: uart = UART(uart_id, 1000000) uart.deinit() - # test printing an unitialized uart + # test printing an uninitialized uart print(uart) # initialize it back and check that it works again uart.init(115200) diff --git a/tools/ci.sh b/tools/ci.sh index 0eb94b3399..e8c4021f37 100755 --- a/tools/ci.sh +++ b/tools/ci.sh @@ -45,7 +45,7 @@ function ci_code_spell_run { function ci_commit_formatting_run { git remote add upstream https://github.com/micropython/micropython.git git fetch --depth=100 upstream master - # For a PR, upstream/master..HEAD ends with a merge commit into master, exlude that one. + # For a PR, upstream/master..HEAD ends with a merge commit into master, exclude that one. tools/verifygitlog.py -v upstream/master..HEAD --no-merges } diff --git a/tools/mpremote/mpremote/commands.py b/tools/mpremote/mpremote/commands.py index fe0283ce6f..8bcb73b6ff 100644 --- a/tools/mpremote/mpremote/commands.py +++ b/tools/mpremote/mpremote/commands.py @@ -78,7 +78,7 @@ def do_disconnect(state, _args=None): state.pyb.exit_raw_repl() except OSError: # Ignore any OSError exceptions when shutting down, eg: - # - pyboard.filesystem_command will close the connecton if it had an error + # - pyboard.filesystem_command will close the connection if it had an error # - umounting will fail if serial port disappeared pass state.pyb.close() diff --git a/tools/pydfu.py b/tools/pydfu.py index f2d845a70b..05cdf92c99 100755 --- a/tools/pydfu.py +++ b/tools/pydfu.py @@ -484,7 +484,7 @@ def get_memory_layout(device): def list_dfu_devices(*args, **kwargs): - """Prints a lits of devices detected in DFU mode.""" + """Prints a list of devices detected in DFU mode.""" devices = get_dfu_devices(*args, **kwargs) if not devices: raise SystemExit("No DFU capable devices found") diff --git a/tools/uncrustify.cfg b/tools/uncrustify.cfg index 28eb49faf7..bf5e37bf3f 100644 --- a/tools/uncrustify.cfg +++ b/tools/uncrustify.cfg @@ -1326,7 +1326,7 @@ indent_using_block = true # true/false # 2: When the `:` is a continuation, indent it under `?` indent_ternary_operator = 0 # unsigned number -# Whether to indent the statments inside ternary operator. +# Whether to indent the statements inside ternary operator. indent_inside_ternary_operator = false # true/false # If true, the indentation of the chunks after a `return` sequence will be set at return indentation column. @@ -1782,7 +1782,7 @@ nl_func_call_args_multi_line = false # true/false # different lines. nl_func_call_end_multi_line = false # true/false -# Whether to respect nl_func_call_XXX option incase of closure args. +# Whether to respect nl_func_call_XXX option in case of closure args. nl_func_call_args_multi_line_ignore_closures = false # true/false # Whether to add a newline after '<' of a template parameter list. @@ -2573,7 +2573,7 @@ align_oc_decl_colon = false # true/false # (OC) Whether to not align parameters in an Objectve-C message call if first # colon is not on next line of the message call (the same way Xcode does -# aligment) +# alignment) align_oc_msg_colon_xcode_like = false # true/false # @@ -2919,28 +2919,28 @@ pp_define_at_level = false # true/false pp_ignore_define_body = false # true/false # Whether to indent case statements between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the case statements +# Only applies to the indent of the preprocessor that the case statements # directly inside of. # # Default: true pp_indent_case = true # true/false # Whether to indent whole function definitions between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the function definition +# Only applies to the indent of the preprocessor that the function definition # is directly inside of. # # Default: true pp_indent_func_def = true # true/false # Whether to indent extern C blocks between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the extern block is +# Only applies to the indent of the preprocessor that the extern block is # directly inside of. # # Default: true pp_indent_extern = true # true/false # Whether to indent braces directly inside #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the braces are directly +# Only applies to the indent of the preprocessor that the braces are directly # inside of. # # Default: true diff --git a/tools/verifygitlog.py b/tools/verifygitlog.py index c237cb46be..ee3e119f37 100755 --- a/tools/verifygitlog.py +++ b/tools/verifygitlog.py @@ -139,7 +139,7 @@ def run(args): def show_help(): print("usage: verifygitlog.py [-v -n -h --check-file] ...") - print("-v : increase verbosity, can be speficied multiple times") + print("-v : increase verbosity, can be specified multiple times") print("-n : do not print multi-line suggestions") print("-h : print this help message and exit") print(