all: Fix spelling mistakes based on codespell check.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2023-03-08 14:10:02 +11:00
parent e160fe7bc6
commit b1229efbd1
191 changed files with 282 additions and 282 deletions

View File

@ -1,6 +1,6 @@
--- ---
name: Security report name: Security report
about: Report a security issue or vunerability in MicroPython about: Report a security issue or vulnerability in MicroPython
title: '' title: ''
labels: security labels: security
assignees: '' assignees: ''

View File

@ -255,7 +255,7 @@ Documentation conventions
========================= =========================
MicroPython generally follows CPython in documentation process and 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: Specific conventions/suggestions:

View File

@ -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 ``SRC_USERMOD_C`` or ``SRC_USERMOD_LIB_C`` variables. The former will be
processed for ``MP_QSTR_`` and ``MP_REGISTER_MODULE`` definitions, the latter processed for ``MP_QSTR_`` and ``MP_REGISTER_MODULE`` definitions, the latter
will not (e.g. helpers and library code that isn't MicroPython-specific). 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_C += $(EXAMPLE_MOD_DIR)/modexample.c
SRC_USERMOD_LIB_C += $(EXAMPLE_MOD_DIR)/utils/algorithm.c SRC_USERMOD_LIB_C += $(EXAMPLE_MOD_DIR)/utils/algorithm.c

View File

@ -17,7 +17,7 @@ Requirements
The first thing you need is a board with an ESP32 chip. The MicroPython 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 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 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. UART available to your PC.
Names of pins will be given in this tutorial using the chip names (eg GPIO2) 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 procedure for these steps is highly dependent on the particular board and you will
need to refer to its documentation for details. 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 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 all steps can be done automatically. Boards that have such features
include the Adafruit Feather HUZZAH32, M5Stack, Wemos LOLIN32, and TinyPICO 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) 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 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 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 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 * The flashing instructions above use flashing speed of 460800 baud, which is
good compromise between speed and stability. However, depending on your 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 may be too high and lead to errors. Try a more common 115200 baud
rate instead in such cases. rate instead in such cases.

View File

@ -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 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 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 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 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 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 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. 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 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 be easy as all steps can be done automatically. Boards that have such features
include the Adafruit Feather HUZZAH and NodeMCU boards. 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) 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 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. the tutorial will discuss the prompt in more detail.
WiFi WiFi
@ -137,7 +137,7 @@ WiFi
After a fresh install and boot the device configures itself as a WiFi access 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 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 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 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 will be 192.168.4.1 once you connect to its network. WiFi configuration will
be discussed in more detail later in the tutorial. 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 * The flashing instructions above use flashing speed of 460800 baud, which is
good compromise between speed and stability. However, depending on your 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 may be too high and lead to errors. Try a more common 115200 baud
rate instead in such cases. rate instead in such cases.

View File

@ -13,7 +13,7 @@ REPL over the serial port
The REPL is always available on the UART0 serial peripheral, which is connected 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. 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 the REPL directly from your PC. Otherwise you will need to have a way of
communicating with the UART. communicating with the UART.

View File

@ -75,7 +75,7 @@ Classes
Returns the string representation of the array, called as ``str(a)`` or ``repr(a)``` Returns the string representation of the array, called as ``str(a)`` or ``repr(a)```
(where ``a`` is an ``array``). Returns the string ``"array(<type>, [<elements>])"``, (where ``a`` is an ``array``). Returns the string ``"array(<type>, [<elements>])"``,
where ``<type>`` is the type code letter for the array and ``<elements>`` is a comma where ``<type>`` is the type code letter for the array and ``<elements>`` 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 **Note:** ``__repr__`` cannot be called directly (``a.__repr__()`` fails) and
is not present in ``__dict__``, however ``str(a)`` and ``repr(a)`` both work. is not present in ``__dict__``, however ``str(a)`` and ``repr(a)`` both work.

View File

@ -44,7 +44,7 @@ Configuration
Get or set configuration values of the BLE interface. To get a value the 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 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. parameter can be set at a time.
Currently supported values are: Currently supported values are:

View File

@ -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 and an ``OSError(-261)`` is raised if called on firmware that doesn't have the
feature enabled. feature enabled.
It is OK to call ``mark_app_valid_cancel_rollback`` on every boot and it is not 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 Constants
~~~~~~~~~ ~~~~~~~~~

View File

@ -4,7 +4,7 @@
class ADC -- analog to digital conversion 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 represents a single endpoint that can sample a continuous voltage and
convert it to a discretised value. convert it to a discretised value.

View File

@ -94,7 +94,7 @@ General Methods
- *freq* is the SCL clock rate - *freq* is the SCL clock rate
In the case of hardware I2C the actual clock frequency may be lower than the 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. rate may be determined by printing the I2C object.
.. method:: I2C.deinit() .. method:: I2C.deinit()

View File

@ -103,7 +103,7 @@ Constructor
- ``ibuf`` specifies internal buffer length (bytes) - ``ibuf`` specifies internal buffer length (bytes)
For all ports, DMA runs continuously in the background and allows user applications to perform other operations while 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 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). before underflow (e.g. ``write`` method) or overflow (e.g. ``readinto`` method).

View File

@ -98,7 +98,7 @@ Methods
specify them as a tuple of ``pins`` parameter. specify them as a tuple of ``pins`` parameter.
In the case of hardware SPI the actual clock frequency may be lower than the 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. rate may be determined by printing the SPI object.
.. method:: SPI.deinit() .. method:: SPI.deinit()

View File

@ -73,7 +73,7 @@ Methods
- ``callback`` - The callable to call upon expiration of the timer period. - ``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 must take one argument, which is passed the Timer object.
The ``callback`` argument shall be specified. Otherwise an exception 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`` ``TypeError: 'NoneType' object isn't callable``
.. method:: Timer.deinit() .. method:: Timer.deinit()

View File

@ -86,7 +86,7 @@ Filesystem access
.. function:: statvfs(path) .. 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: Returns a tuple with the filesystem information in the following order:

View File

@ -272,7 +272,7 @@ Methods
- *fdf* for CAN FD controllers, if set to True, the frame will have an FD - *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. frame format, which supports data payloads up to 64 bytes.
- *brs* for CAN FD controllers, if set to True, the bitrate switching mode - *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. 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 If timeout is 0 the message is placed in a buffer in one of three hardware

View File

@ -97,7 +97,7 @@ Methods
errors properly) errors properly)
The actual clock frequency may be lower than the requested frequency. 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. by printing the I2C object.
.. method:: I2C.is_ready(addr) .. method:: I2C.is_ready(addr)

View File

@ -46,7 +46,7 @@ Functions
.. function:: settrace(tracefunc) .. function:: settrace(tracefunc)
Enable tracing of bytecode execution. For details see the `CPython Enable tracing of bytecode execution. For details see the `CPython
documentaion <https://docs.python.org/3/library/sys.html#sys.settrace>`_. documentation <https://docs.python.org/3/library/sys.html#sys.settrace>`_.
This function requires a custom MicroPython build as it is typically not This function requires a custom MicroPython build as it is typically not
present in pre-built firmware (due to it affecting performance). The relevant present in pre-built firmware (due to it affecting performance). The relevant

View File

@ -163,8 +163,8 @@ Functions
However, values returned by `ticks_ms()`, etc. functions may wrap around, so However, values returned by `ticks_ms()`, etc. functions may wrap around, so
directly using subtraction on them will produce incorrect result. That is why directly using subtraction on them will produce incorrect result. That is why
`ticks_diff()` is needed, it implements modular (or more specifically, ring) `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 arithmetic 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 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 [*-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 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 *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 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 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 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: `ticks_diff()` is designed to accommodate various usage patterns, among them:

View File

@ -32,7 +32,7 @@ Functions
* *CPU utilization is only printed if runtime statistics are configured via the ``CONFIG_THREAD_RUNTIME_STATS`` kconfig* * *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``. 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
<https://docs.zephyrproject.org/latest/guides/debug_tools/thread-analyzer.html#thread-analyzer>`_. <https://docs.zephyrproject.org/latest/guides/debug_tools/thread-analyzer.html#thread-analyzer>`_.
.. function:: shell_exec(cmd_in) .. function:: shell_exec(cmd_in)

View File

@ -120,7 +120,7 @@ minus sign in front of the y-coordinate in the ``hid.send()`` line above.
Restoring your pyboard to normal 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 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. 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 In the ``boot.py`` file, comment out (put a # in front of) the line with the

View File

@ -75,7 +75,7 @@ Execute the next instruction if <condition> is true:
* ite(<condition>) If then else * ite(<condition>) If then else
If <condtion> is true, execute the next instruction, otherwise execute the If <condition> is true, execute the next instruction, otherwise execute the
subsequent one. Thus: subsequent one. Thus:
:: ::
@ -86,5 +86,5 @@ subsequent one. Thus:
mov(r0, 200) # runs if r0 != r1 mov(r0, 200) # runs if r0 != r1
# execution continues here # 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. where x,y,z=t/e; e.g. itt, itee, itete, ittte, itttt, iteee, etc.

View File

@ -264,7 +264,7 @@ were a string.
**Runtime compiler execution** **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 requires significant amounts of RAM. Note that the ``pickle`` library from
`micropython-lib` employs `exec`. It may be more RAM efficient to use the `micropython-lib` employs `exec`. It may be more RAM efficient to use the
`json` library for object serialisation. `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 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 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 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. delay while ensuring it occurs at points in the program when it is acceptable.

View File

@ -30,7 +30,7 @@ The peripherals include:
* 2 UARTs * 2 UARTs
* 2 SPI controllers * 2 SPI controllers
* 2 I2C contollers * 2 I2C controllers
* 16 PWM channels * 16 PWM channels
* USB 1.1 controller * USB 1.1 controller
* 8 PIO state machines * 8 PIO state machines

View File

@ -96,7 +96,7 @@ Programmable IO (PIO)
--------------------- ---------------------
PIO is useful to build low-level IO interfaces from scratch. See the :mod:`rp2` module 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:: Example using PIO to blink an LED at 1Hz::

View File

@ -10,7 +10,7 @@ REPL over the serial port
The REPL is available on a UART serial peripheral specified for the board by 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. 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. the REPL directly from your PC.
To access the prompt over USB-serial you will need to use a terminal emulator To access the prompt over USB-serial you will need to use a terminal emulator

View File

@ -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); 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) { if (buf[0] != 0x04 || buf[1] != 0x0e) {
printf("unknown response: %02x %02x %02x %02x\n", buf[0], buf[1], buf[2], buf[3]); printf("unknown response: %02x %02x %02x %02x\n", buf[0], buf[1], buf[2], buf[3]);
return -1; return -1;

View File

@ -105,7 +105,7 @@ typedef enum {
NINA_CMD_AP_GET_BSSID = 0x3C, NINA_CMD_AP_GET_BSSID = 0x3C,
NINA_CMD_AP_GET_CHANNEL = 0x3D, NINA_CMD_AP_GET_CHANNEL = 0x3D,
// Disonnect/status commands. // Disconnect/status commands.
NINA_CMD_DISCONNECT = 0x30, NINA_CMD_DISCONNECT = 0x30,
NINA_CMD_CONN_STATUS = 0x20, NINA_CMD_CONN_STATUS = 0x20,
NINA_CMD_CONN_REASON = 0x1F, NINA_CMD_CONN_REASON = 0x1F,

View File

@ -23,7 +23,7 @@ To build the example project, based on `main.c`, use:
$ make $ make
That will create an exacutable called `embed` which you can run: That will create an executable called `embed` which you can run:
$ ./embed $ ./embed

View File

@ -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 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 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 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. use another pin. This of course applies to relays, buzzers, sensors, etc.
With complications above in mind, it's still possible to write portable With complications above in mind, it's still possible to write portable

View File

@ -1,6 +1,6 @@
from machine import Pin, Signal 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) LED = Signal("LED_RED", Pin.OUT)
# Green LED on pin LED_GREEN also known as A14 # Green LED on pin LED_GREEN also known as A14

View File

@ -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 // This must be first, it sets up the globals dict and other things
MP_DYNRUNTIME_INIT_ENTRY 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); mp_printf(&mp_plat_print, "initialising module self=%p\n", self);
// Make the functions available in the module's namespace // Make the functions available in the module's namespace

View File

@ -883,7 +883,7 @@ int mp_bluetooth_gatts_register_service_begin(bool append) {
if (!append) { if (!append) {
// This will reset the DB. // 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). // 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(); att_db_util_init();

View File

@ -29,7 +29,7 @@
#include "py/misc.h" // For MP_STRINGIFY. #include "py/misc.h" // For MP_STRINGIFY.
#include "py/mpconfig.h" #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 // 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. // .c file, but these are made available because they're generally usable.
// TODO: Add more architectures, compilers and libraries. // TODO: Add more architectures, compilers and libraries.

View File

@ -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 // default is to perform complete handshake in constructor, so
// this should not happen in blocking mode. On the other hand, // this should not happen in blocking mode. On the other hand,
// in nonblocking mode EAGAIN (comparing to the alternative of // in nonblocking mode EAGAIN (comparing to the alternative of
// looping) is really preferrable. // looping) is really preferable.
if (o->blocking) { if (o->blocking) {
continue; continue;
} else { } else {

View File

@ -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) { } else if (ret == MBEDTLS_ERR_SSL_WANT_WRITE) {
// If handshake is not finished, read attempt may end up in protocol // If handshake is not finished, read attempt may end up in protocol
// wanting to write next handshake message. The same may happen with // wanting to write next handshake message. The same may happen with
// renegotation. // renegotiation.
ret = MP_EWOULDBLOCK; ret = MP_EWOULDBLOCK;
o->poll_mask = MP_STREAM_POLL_WR; o->poll_mask = MP_STREAM_POLL_WR;
} else { } 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) { } else if (ret == MBEDTLS_ERR_SSL_WANT_READ) {
// If handshake is not finished, write attempt may end up in protocol // If handshake is not finished, write attempt may end up in protocol
// wanting to read next handshake message. The same may happen with // wanting to read next handshake message. The same may happen with
// renegotation. // renegotiation.
ret = MP_EWOULDBLOCK; ret = MP_EWOULDBLOCK;
o->poll_mask = MP_STREAM_POLL_RD; o->poll_mask = MP_STREAM_POLL_RD;
} else { } else {

View File

@ -84,7 +84,7 @@ void hal_uart_start_tx(uint32_t port) {
mp_bluetooth_hci_uart_write(mp_bluetooth_hci_cmd_buf, len); mp_bluetooth_hci_uart_write(mp_bluetooth_hci_cmd_buf, len);
if (len > 0) { 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(); mp_bluetooth_nimble_sent_hci_packet();
} }
} }

View File

@ -652,7 +652,7 @@ int mp_bluetooth_init(void) {
// By default, just register the default gap/gatt service. // By default, just register the default gap/gatt service.
ble_svc_gap_init(); ble_svc_gap_init();
ble_svc_gatt_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 // then we must now call gatts_start to register those services
// and free the heap memory. // and free the heap memory.
// Otherwise it will be realloc'ed on the next stack startup. // 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) { STATIC void unstall_l2cap_channel(void) {
// Whenever we send an HCI packet and the sys mempool is now less than 1/4 full, // 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_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; mp_bluetooth_nimble_l2cap_channel_t *chan = MP_STATE_PORT(bluetooth_nimble_root_pointers)->l2cap_chan;
if (!chan || !chan->mem_stalled) { 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: { 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); 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); 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) { if (!chan->mem_stalled) {
ble_l2cap_get_chan_info(event->receive.chan, &info); ble_l2cap_get_chan_info(event->receive.chan, &info);
// Map status to {0,1} (i.e. "sent everything", or "partial send"). // 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); err = ble_l2cap_send(chan->chan, sdu_tx);
if (err == BLE_HS_ESTALLED) { if (err == BLE_HS_ESTALLED) {
// Stalled means that this one will still send but any future ones // 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"); DEBUG_printf("mp_bluetooth_l2cap_send: credit stall\n");
*stalled = true; *stalled = true;
err = 0; err = 0;

View File

@ -256,7 +256,7 @@ static bool wait_while_blinking (uint32_t wait_time, uint32_t period, bool force
_u32 count; _u32 count;
for (count = 0; (force_wait || MAP_GPIOPinRead(MICROPY_SAFE_BOOT_PORT, MICROPY_SAFE_BOOT_PORT_PIN)) && for (count = 0; (force_wait || MAP_GPIOPinRead(MICROPY_SAFE_BOOT_PORT, MICROPY_SAFE_BOOT_PORT_PIN)) &&
((period * count) < wait_time); count++) { ((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)); 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)); UtilsDelay(UTILS_DELAY_US_TO_COUNT(period * 1000));
} }

View File

@ -269,7 +269,7 @@ DSTATUS sd_disk_init (void) {
// Fill in the RCA // Fill in the RCA
sd_disk_info.usRCA = (ulResp[0] >> 16); sd_disk_info.usRCA = (ulResp[0] >> 16);
// Get tha card capacity // Get the card capacity
CardCapacityGet(&sd_disk_info); CardCapacityGet(&sd_disk_info);
} }

View File

@ -97,7 +97,7 @@ typedef enum {
typedef struct { typedef struct {
bool uservalid : 1; bool uservalid : 1;
bool passvalid : 1; bool passvalid : 1;
} ftp_loggin_t; } ftp_login_t;
typedef enum { typedef enum {
E_FTP_NOTHING_OPEN = 0, E_FTP_NOTHING_OPEN = 0,
@ -127,8 +127,8 @@ typedef struct {
uint8_t state; uint8_t state;
uint8_t substate; uint8_t substate;
uint8_t txRetries; uint8_t txRetries;
uint8_t logginRetries; uint8_t loginRetries;
ftp_loggin_t loggin; ftp_login_t login;
uint8_t e_open; uint8_t e_open;
bool closechild; bool closechild;
bool enabled; 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 (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)) { if (E_FTP_RESULT_OK == ftp_wait_for_connection(ftp_data.lc_sd, &ftp_data.c_sd)) {
ftp_data.txRetries = 0; ftp_data.txRetries = 0;
ftp_data.logginRetries = 0; ftp_data.loginRetries = 0;
ftp_data.ctimeout = 0; ftp_data.ctimeout = 0;
ftp_data.loggin.uservalid = false; ftp_data.login.uservalid = false;
ftp_data.loggin.passvalid = false; ftp_data.login.passvalid = false;
strcpy (ftp_path, "/"); strcpy (ftp_path, "/");
ftp_send_reply (220, "MicroPython FTP Server"); ftp_send_reply (220, "MicroPython FTP Server");
break; 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))) { 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 // bufptr is moved as commands are being popped
ftp_cmd_index_t cmd = ftp_pop_command(&bufptr); 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); ftp_send_reply(332, NULL);
return; return;
} }
@ -754,16 +754,16 @@ static void ftp_process_cmd (void) {
case E_FTP_CMD_USER: case E_FTP_CMD_USER:
ftp_pop_param (&bufptr, ftp_scratch_buffer); ftp_pop_param (&bufptr, ftp_scratch_buffer);
if (!memcmp(ftp_scratch_buffer, servers_user, MAX(strlen(ftp_scratch_buffer), strlen(servers_user)))) { 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); ftp_send_reply(331, NULL);
break; break;
case E_FTP_CMD_PASS: case E_FTP_CMD_PASS:
ftp_pop_param (&bufptr, ftp_scratch_buffer); ftp_pop_param (&bufptr, ftp_scratch_buffer);
if (!memcmp(ftp_scratch_buffer, servers_pass, MAX(strlen(ftp_scratch_buffer), strlen(servers_pass))) && if (!memcmp(ftp_scratch_buffer, servers_pass, MAX(strlen(ftp_scratch_buffer), strlen(servers_pass))) &&
ftp_data.loggin.uservalid) { ftp_data.login.uservalid) {
ftp_data.loggin.passvalid = true && (strlen(servers_pass) == strlen(ftp_scratch_buffer)); ftp_data.login.passvalid = true && (strlen(servers_pass) == strlen(ftp_scratch_buffer));
if (ftp_data.loggin.passvalid) { if (ftp_data.login.passvalid) {
ftp_send_reply(230, NULL); ftp_send_reply(230, NULL);
break; break;
} }

View File

@ -127,7 +127,7 @@ void mperror_deinit_sfe_pin (void) {
void mperror_signal_error (void) { void mperror_signal_error (void) {
uint32_t count = 0; uint32_t count = 0;
while ((MPERROR_TOOGLE_MS * count++) < MPERROR_SIGNAL_ERROR_MS) { 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)); 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)); UtilsDelay(UTILS_DELAY_US_TO_COUNT(MPERROR_TOOGLE_MS * 1000));
} }

View File

@ -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 // switch to the requested mode
wlan_set_mode(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); wlan_reenable(mode);
// Set Tx power level for station or AP 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 // save the ssid
memcpy(&wlan_obj.ssid, ssid, len); 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 // 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) { if (add_mac) {
snprintf((char *)&wlan_obj.ssid[len], sizeof(wlan_obj.ssid) - len, "-%02x%02x", wlan_obj.mac[4], wlan_obj.mac[5]); snprintf((char *)&wlan_obj.ssid[len], sizeof(wlan_obj.ssid) - len, "-%02x%02x", wlan_obj.mac[4], wlan_obj.mac[5]);
len += 5; len += 5;

View File

@ -113,7 +113,7 @@ STATIC pybpin_wake_pin_t pybpin_wake_pin[PYBPIN_NUM_WAKE_PINS] =
DEFINE PUBLIC FUNCTIONS DEFINE PUBLIC FUNCTIONS
******************************************************************************/ ******************************************************************************/
void pin_init0(void) { void pin_init0(void) {
// this initalization also reconfigures the JTAG/SWD pins // this initialization also reconfigures the JTAG/SWD pins
#ifndef DEBUG #ifndef DEBUG
// assign all pins to the GPIO module so that peripherals can be connected to any // assign all pins to the GPIO module so that peripherals can be connected to any
// pins without conflicts after a soft reset // 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; uint strength = args[3].u_int;
pin_validate_drive(strength); pin_validate_drive(strength);

View File

@ -76,7 +76,7 @@ STATIC void rtc_msec_add(uint16_t msecs_1, uint32_t *secs, uint16_t *msecs_2);
******************************************************************************/ ******************************************************************************/
__attribute__ ((section (".boot"))) __attribute__ ((section (".boot")))
void pyb_rtc_pre_init(void) { 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) { if (MAP_PRCMSysResetCauseGet() == PRCM_POWER_ON) {
// Mark the RTC in use first // Mark the RTC in use first
MAP_PRCMRTCInUseSet(); MAP_PRCMRTCInUseSet();
@ -118,7 +118,7 @@ void pyb_rtc_repeat_alarm (pyb_rtc_obj_t *self) {
pyb_rtc_get_time(&c_seconds, &c_mseconds); 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 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; int32_t next_alarm = self->alarm_ms - wake_ms;
next_alarm = next_alarm > 0 ? next_alarm : PYB_RTC_MIN_ALARM_TIME_MS; next_alarm = next_alarm > 0 ? next_alarm : PYB_RTC_MIN_ALARM_TIME_MS;

View File

@ -71,7 +71,7 @@ STATIC mp_obj_t pyb_sd_deinit (mp_obj_t self_in);
/****************************************************************************** /******************************************************************************
DEFINE PRIVATE FUNCTIONS 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) { STATIC void pyb_sd_hw_init (pybsd_obj_t *self) {
if (self->pin_clk) { if (self->pin_clk) {
// Configure the clock pin as output only // Configure the clock pin as output only

View File

@ -160,13 +160,13 @@ void pyb_sleep_init0 (void) {
// register and enable the PRCM interrupt // register and enable the PRCM interrupt
osi_InterruptRegister(INT_PRCM, (P_OSI_INTR_ENTRY)PRCMInterruptHandler, INT_PRIORITY_LVL_1); 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_GPIO);
MAP_PRCMLPDSWakeupSourceDisable(PRCM_LPDS_TIMER); MAP_PRCMLPDSWakeupSourceDisable(PRCM_LPDS_TIMER);
MAP_PRCMHibernateWakeupSourceDisable(PRCM_HIB_SLOW_CLK_CTR | PRCM_HIB_GPIO2 | PRCM_HIB_GPIO4 | PRCM_HIB_GPIO13 | 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); 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) { if (pybsleep_reset_cause != PYB_SLP_SOFT_RESET) {
switch (MAP_PRCMSysResetCauseGet()) { switch (MAP_PRCMSysResetCauseGet()) {
case PRCM_POWER_ON: case PRCM_POWER_ON:

View File

@ -158,7 +158,7 @@ soft_reset:
// to enable simplelink and leave it as is // to enable simplelink and leave it as is
wlan_first_start(); wlan_first_start();
} else { } 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(); mptask_enter_ap_mode();
} }
@ -315,7 +315,7 @@ STATIC void mptask_init_sflash_filesystem(void) {
// create empty main.py // create empty main.py
mptask_create_main_py(); mptask_create_main_py();
} else if (res == FR_OK) { } else if (res == FR_OK) {
// mount sucessful // mount successful
if (FR_OK != f_stat(&vfs_fat->fatfs, "/main.py", &fno)) { if (FR_OK != f_stat(&vfs_fat->fatfs, "/main.py", &fno)) {
// create empty main.py // create empty main.py
mptask_create_main_py(); mptask_create_main_py();

View File

@ -111,7 +111,7 @@ void TASK_Servers(void *pvParameters) {
ftp_reset(); ftp_reset();
} }
// and we should also close all user sockets. We do it here // 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(); modusocket_close_all_user_sockets();
} }

View File

@ -407,7 +407,7 @@ static void telnet_process (void) {
_i16 rxLen; _i16 rxLen;
_i16 maxLen = (telnet_data.rxWindex >= telnet_data.rxRindex) ? (TELNET_RX_BUFFER_SIZE - telnet_data.rxWindex) : _i16 maxLen = (telnet_data.rxWindex >= telnet_data.rxRindex) ? (TELNET_RX_BUFFER_SIZE - telnet_data.rxWindex) :
((telnet_data.rxRindex - telnet_data.rxWindex) - 1); ((telnet_data.rxRindex - telnet_data.rxWindex) - 1);
// to avoid an overrrun // to avoid an overrun
maxLen = (telnet_data.rxRindex == 0) ? (maxLen - 1) : maxLen; maxLen = (telnet_data.rxRindex == 0) ? (maxLen - 1) : maxLen;
if (maxLen > 0) { if (maxLen > 0) {

View File

@ -59,7 +59,7 @@ void CRYPTOHASH_SHAMD5Start (uint32_t algo, uint32_t blocklen) {
HWREG(SHAMD5_BASE + SHAMD5_O_MODE) |= SHAMD5_MODE_CLOSE_HASH; HWREG(SHAMD5_BASE + SHAMD5_O_MODE) |= SHAMD5_MODE_CLOSE_HASH;
} }
// set the lenght // set the length
HWREG(SHAMD5_BASE + SHAMD5_O_LENGTH) = blocklen; HWREG(SHAMD5_BASE + SHAMD5_O_LENGTH) = blocklen;
} }

View File

@ -350,7 +350,7 @@ STATIC void set_duty_u16(machine_pwm_obj_t *self, int duty) {
/* /*
// Bug: Sometimes duty is not set right now. // 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. // 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 // See https://github.com/espressif/esp-idf/issues/7288
if (duty != get_duty_u16(self)) { 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); 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)) { 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; int timer_idx;
@ -607,7 +607,7 @@ STATIC void mp_machine_pwm_deinit(machine_pwm_obj_t *self) {
self->duty_x = 0; 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) { STATIC mp_obj_t mp_machine_pwm_freq_get(machine_pwm_obj_t *self) {
pwm_is_active(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) { STATIC void mp_machine_pwm_freq_set(machine_pwm_obj_t *self, mp_int_t freq) {
pwm_is_active(self); pwm_is_active(self);
if ((freq <= 0) || (freq > 40000000)) { 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) { if (freq == timers[TIMER_IDX(self->mode, self->timer)].freq_hz) {
return; return;

View File

@ -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); 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--) { for (i = *local_channel - 1; i > 0; i--) {
local_single[i].h_time -= local_single[i - 1].h_time; local_single[i].h_time -= local_single[i - 1].h_time;
} }

View File

@ -79,7 +79,7 @@
#define SPI_MOSI_DELAY_NUM 0x00000007 #define SPI_MOSI_DELAY_NUM 0x00000007
#define SPI_MOSI_DELAY_NUM_S 23 #define SPI_MOSI_DELAY_NUM_S 23
#define SPI_MOSI_DELAY_MODE 0x00000003 //mode 0 : posedge; data set at positive edge of clk #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. //mode 2 : Do not use this mode.
#define SPI_MOSI_DELAY_MODE_S 21 #define SPI_MOSI_DELAY_MODE_S 21
#define SPI_MISO_DELAY_NUM 0x00000007 #define SPI_MISO_DELAY_NUM 0x00000007

View File

@ -3,7 +3,7 @@
* *
* FileName: uart.c * 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. * Check your hardware connection while use this mode.
* *
* Modification history: * Modification history:
@ -164,7 +164,7 @@ uart_os_config(int uart) {
*******************************************************************************/ *******************************************************************************/
static void uart0_rx_intr_handler(void *para) { 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 * uart1 and uart0 respectively
*/ */

View File

@ -172,7 +172,7 @@ void BOARD_BootClockRUN(void) {
(ANADIG_OSC->OSC_24M_CTRL & ANADIG_OSC_OSC_24M_CTRL_OSC_24M_STABLE_MASK)) { (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.mux = kCLOCK_M7_ClockRoot_MuxOscRc48MDiv2;
rootCfg.div = 1; rootCfg.div = 1;
#if __CORTEX_M == 7 #if __CORTEX_M == 7

View File

@ -11,7 +11,7 @@ or for Teensy 4.1:
teensy_loader_cli --mcu=imxrt1062 -v -w TEENSY41-<date_version_tag>.hex teensy_loader_cli --mcu=imxrt1062 -v -w TEENSY41-<date_version_tag>.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 TEENSY40, TEENSY41 or TEENSY_MICROMOD. When loading the firmware the PJRC boot loader
will erase the board file system. will erase the board file system.

View File

@ -123,7 +123,7 @@ enum
kFlexSpiDeviceType_SerialNAND = 2, // !< Flash devices are Serial NAND kFlexSpiDeviceType_SerialNAND = 2, // !< Flash devices are Serial NAND
kFlexSpiDeviceType_SerialRAM = 3, // !< Flash devices are Serial RAM/HyperFLASH 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_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 // !@brief Flash Pad Definitions
@ -184,7 +184,7 @@ typedef struct _FlexSPIConfig
// ! details // ! details
uint8_t deviceType; // !< [0x044-0x044] Device Type: See Flash Type Definition for more 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 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 // ! Chapter for more details
uint8_t lutCustomSeqEnable; // !< [0x047-0x047] LUT customization Enable, it is required if the program/erase cannot 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 // ! 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 serialNorType; // !< Serial NOR Flash type: 0/1/2/3
uint8_t needExitNoCmdMode; // !< Need to exit NoCmd mode before other IP command 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 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 blockSize; // !< Block size
uint32_t reserve2[11]; // !< Reserved for future use uint32_t reserve2[11]; // !< Reserved for future use
} flexspi_nor_config_t; } flexspi_nor_config_t;

View File

@ -97,7 +97,7 @@ typedef struct _boot_data_ {
uint32_t start; /* boot start location */ uint32_t start; /* boot start location */
uint32_t size; /* size */ uint32_t size; /* size */
uint32_t plugin; /* plugin flag - 1 if downloaded application is plugin */ 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; }BOOT_DATA_T;
#if defined(BOARD_FLASH_SIZE) #if defined(BOARD_FLASH_SIZE)

View File

@ -117,7 +117,7 @@ status_t PHY_DP83825_GetLinkStatus(phy_handle_t *handle, bool *status);
* @brief Gets the PHY link speed and duplex. * @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 * @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 handle PHY device handle.
* @param speed The address of PHY link speed. * @param speed The address of PHY link speed.

View File

@ -117,7 +117,7 @@ status_t PHY_DP83848_GetLinkStatus(phy_handle_t *handle, bool *status);
* @brief Gets the PHY link speed and duplex. * @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 * @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 handle PHY device handle.
* @param speed The address of PHY link speed. * @param speed The address of PHY link speed.

View File

@ -117,7 +117,7 @@ status_t PHY_KSZ8081_GetLinkStatus(phy_handle_t *handle, bool *status);
* @brief Gets the PHY link speed and duplex. * @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 * @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 handle PHY device handle.
* @param speed The address of PHY link speed. * @param speed The address of PHY link speed.

View File

@ -117,7 +117,7 @@ status_t PHY_LAN8720_GetLinkStatus(phy_handle_t *handle, bool *status);
* @brief Gets the PHY link speed and duplex. * @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 * @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 handle PHY device handle.
* @param speed The address of PHY link speed. * @param speed The address of PHY link speed.

View File

@ -117,7 +117,7 @@ status_t PHY_RTL8211F_GetLinkStatus(phy_handle_t *handle, bool *status);
* @brief Gets the PHY link speed and duplex. * @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 * @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 handle PHY device handle.
* @param speed The address of PHY link speed. * @param speed The address of PHY link speed.

View File

@ -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 Gets the PHY link speed and duplex.
* *
* @brief This function gets the speed and duplex mode of PHY. User can give one of speed * @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 handle PHY device handle.
* @param speed The address of PHY link speed. * @param speed The address of PHY link speed.

View File

@ -60,7 +60,7 @@ Reset_Handler:
* linker script. * linker script.
* __etext: End of code section, i.e., begin of data sections to copy from. * __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 * __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 * __ram_function_start__/__ram_function_end__ : ramfunction region
* copied to. Both must be aligned to 4 bytes boundary. */ * copied to. Both must be aligned to 4 bytes boundary. */
@ -80,7 +80,7 @@ Reset_Handler:
str r0, [r2, r3] str r0, [r2, r3]
bgt .LC0 bgt .LC0
.LC1: .LC1:
#else /* code size implemenation */ #else /* code size implementation */
.LC0: .LC0:
cmp r2, r3 cmp r2, r3
ittt lt ittt lt
@ -103,7 +103,7 @@ Reset_Handler:
str r0, [r2, r3] str r0, [r2, r3]
bgt .LC_ramfunc_copy_start bgt .LC_ramfunc_copy_start
.LC_ramfunc_copy_end: .LC_ramfunc_copy_end:
#else /* code size implemenation */ #else /* code size implementation */
.LC_ramfunc_copy_start: .LC_ramfunc_copy_start:
cmp r2, r3 cmp r2, r3
ittt lt ittt lt
@ -127,7 +127,7 @@ Reset_Handler:
str r0, [r2, r3] str r0, [r2, r3]
bgt .LC2 bgt .LC2
.LC3: .LC3:
#else /* code size implemenation */ #else /* code size implementation */
.LC2: .LC2:
cmp r2, r3 cmp r2, r3
ittt lt ittt lt

View File

@ -826,7 +826,7 @@ STATIC bool i2s_init(machine_i2s_obj_t *self) {
memset(self->edmaTcd, 0, sizeof(edma_tcd_t)); 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_TcdSetTransferConfig(self->edmaTcd, &transferConfig, self->edmaTcd);
EDMA_TcdEnableInterrupts(self->edmaTcd, kEDMA_MajorInterruptEnable | kEDMA_HalfInterruptEnable); EDMA_TcdEnableInterrupts(self->edmaTcd, kEDMA_MajorInterruptEnable | kEDMA_HalfInterruptEnable);
EDMA_InstallTCD(DMA0, self->dma_channel, self->edmaTcd); EDMA_InstallTCD(DMA0, self->dma_channel, self->edmaTcd);

View File

@ -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, 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) { uint8_t *module, uint8_t *submodule, uint8_t *channel) {
const char *str; 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) { 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; const char *str;
size_t len; size_t len;
@ -558,7 +558,7 @@ void machine_pwm_deinit_all(void) {
for (int i = 1; i < ARRAY_SIZE(pwm_bases); i++) { for (int i = 1; i < ARRAY_SIZE(pwm_bases); i++) {
PWM_StopTimer(pwm_bases[i], 0x0f); // Stop all submodules 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 #ifdef FSL_FEATURE_SOC_TMR_COUNT

View File

@ -40,7 +40,7 @@
#define MP_HAL_PIN_FMT "%q" #define MP_HAL_PIN_FMT "%q"
extern ringbuf_t stdin_ringbuf; 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. // the symbol uwTick for the systick ms counter.
#define uwTick systick_ms #define uwTick systick_ms

View File

@ -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_transfer_complete_callback(USDHC_Type *base, usdhc_handle_t *handle, status_t status, void *userData);
void sdcard_dummy_callback(USDHC_Type *base, 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_go_idle_state(mimxrt_sdcard_obj_t *card);
static bool sdcard_cmd_oper_cond(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); static bool sdcard_cmd_app_cmd(mimxrt_sdcard_obj_t *card);

View File

@ -28,7 +28,7 @@ SECTIONS
. = ALIGN(4); . = ALIGN(4);
_etext = .; /* define a global symbol at end of code */ _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 } >FLASH
/* This is the initialized data section /* This is the initialized data section

View File

@ -98,7 +98,7 @@ Note: further tuning of features to include in bluetooth or even setting up the
## Compile with freeze manifest ## 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 `manifest.py`. This can either be done by a `make` invocation or by defining
it in the specific target board's `mpconfigboard.mk`. it in the specific target board's `mpconfigboard.mk`.
@ -132,8 +132,8 @@ For example:
## Set file system size ## Set file system size
The size of the file system on the internal flash is configured by the linker 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 script parameter `_fs_size`. This can either be overridden by the linker script
or dynamically through the makefile. By seting a value to the `FS_SIZE`. 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 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 the start and end of the file system. Note that the parameter value must be in
linker script syntax as it is passed directly. 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 The `intelhex` provides the `hexmerge.py` utility which is used by the Makefile
to trim of the MBR in case SoftDevice flashing is requested. 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: in addition to the `deploy` target of make. For example:
make BOARD=nrf52840-mdk-usb-dongle NRFUTIL_PORT=/dev/ttyACM0 deploy make BOARD=nrf52840-mdk-usb-dongle NRFUTIL_PORT=/dev/ttyACM0 deploy

View File

@ -23,7 +23,7 @@ import time
class IMU: class IMU:
def __init__(self, bus): 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(): if 0x68 in bus.scan():
from bmm150 import BMM150 from bmm150 import BMM150
from bmi270 import BMI270 from bmi270 import BMI270

View File

@ -13,7 +13,7 @@ SUPPORTED_FN = {"UART": ["RX", "TX", "CTS", "RTS"]}
def parse_pin(name_str): def parse_pin(name_str):
"""Parses a string and returns a pin-num.""" """Parses a string and returns a pin-num."""
if len(name_str) < 1: 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": if name_str[0] != "P":
raise ValueError("Expecting pin name to start with P") raise ValueError("Expecting pin name to start with P")
pin_str = name_str[1:].split("/")[0] pin_str = name_str[1:].split("/")[0]

View File

@ -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); const char *str = mp_obj_str_get_data(args[0], &len);
// make image from string // make image from string
if (len == 1) { 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]); return microbit_image_for_char(str[0]);
} else { } else {
/* Otherwise parse the image description string */ /* 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); greyscaleSetPixelValue(dest, i+xdest-x, j+ydest-y, val);
} }
} }
// Adjust intersection rectange to dest // Adjust intersection rectangle to dest
intersect_x0 += xdest-x; intersect_x0 += xdest-x;
intersect_y0 += ydest-y; intersect_y0 += ydest-y;
intersect_x1 += xdest-x; intersect_x1 += xdest-x;

View File

@ -480,7 +480,7 @@ bool ble_drv_advertise_data(ubluepy_advertise_data_t * p_adv_params) {
// do encoding into the adv buffer // do encoding into the adv buffer
if (sd_ble_uuid_encode(&uuid, &encoded_size, &adv_data[byte_pos]) != 0) { 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); 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 // do encoding into the adv buffer
if (sd_ble_uuid_encode(&uuid, &encoded_size, &adv_data[byte_pos]) != 0) { 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); 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 > 0) && (p_adv_params->p_data != NULL)) {
if (p_adv_params->data_len + byte_pos > BLE_GAP_ADV_MAX_SIZE) { 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); 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) #if (BLUETOOTH_SD == 110)
m_adv_params.fp = BLE_GAP_ADV_FP_ANY; m_adv_params.fp = BLE_GAP_ADV_FP_ANY;
m_adv_params.timeout = 0; // infinite advertisment m_adv_params.timeout = 0; // infinite advertisement
#else #else
m_adv_params.properties.anonymous = 0; m_adv_params.properties.anonymous = 0;
m_adv_params.properties.include_tx_power = 0; m_adv_params.properties.include_tx_power = 0;
m_adv_params.filter_policy = 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.primary_phy = BLE_GAP_PHY_AUTO;
m_adv_params.secondary_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. 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 (BLUETOOTH_SD == 110)
if ((err_code = sd_ble_gap_adv_data_set(adv_data, byte_pos, NULL, 0)) != 0) { if ((err_code = sd_ble_gap_adv_data_set(adv_data, byte_pos, NULL, 0)) != 0) {
mp_raise_msg_varg(&mp_type_OSError, 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 #else
if ((err_code = sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &m_adv_params)) != 0) { 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_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 #endif
BLE_DRIVER_LOG("Set Adv data size: " UINT_FMT "\n", byte_pos); 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 #endif
if (err_code != 0) { if (err_code != 0) {
mp_raise_msg_varg(&mp_type_OSError, 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; m_adv_in_progress = true;
@ -641,12 +641,12 @@ void ble_drv_advertise_stop(void) {
#if (BLUETOOTH_SD == 110) #if (BLUETOOTH_SD == 110)
if ((err_code = sd_ble_gap_adv_stop()) != 0) { if ((err_code = sd_ble_gap_adv_stop()) != 0) {
mp_raise_msg_varg(&mp_type_OSError, 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 #else
if ((err_code = sd_ble_gap_adv_stop(m_adv_handle)) != 0) { if ((err_code = sd_ble_gap_adv_stop(m_adv_handle)) != 0) {
mp_raise_msg_varg(&mp_type_OSError, 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 #endif
} }

View File

@ -137,7 +137,7 @@ int set_ticker_callback(uint32_t index, ticker_callback_ptr func, int32_t initia
ticker->INTENCLR = masks[index]; ticker->INTENCLR = masks[index];
ticker->TASKS_CAPTURE[index] = 1; ticker->TASKS_CAPTURE[index] = 1;
uint32_t t = FastTicker->CC[index]; 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. // Use CC[3] as a reference, as that is always up-to-date.
int32_t cc3 = FastTicker->CC[3]; int32_t cc3 = FastTicker->CC[3];
int32_t delta = t+initial_delay_us-cc3; int32_t delta = t+initial_delay_us-cc3;

View File

@ -53,7 +53,7 @@ def generate_eddystone_adv_packet(url):
constants.ad_types.AD_TYPE_SERVICE_DATA, service_data constants.ad_types.AD_TYPE_SERVICE_DATA, service_data
) )
# generate advertisment packet # generate advertisement packet
packet = bytearray([]) packet = bytearray([])
packet.extend(packet_flags) packet.extend(packet_flags)
packet.extend(packet_uuid16) packet.extend(packet_uuid16)

View File

@ -42,7 +42,7 @@ def event_handler(id, handle, data):
rtc.stop() rtc.stop()
# indicate 'disconnected' # indicate 'disconnected'
LED(1).off() LED(1).off()
# restart advertisment # restart advertisement
periph.advertise(device_name="micr_temp", services=[serv_env_sense]) periph.advertise(device_name="micr_temp", services=[serv_env_sense])
elif id == constants.EVT_GATTS_WRITE: elif id == constants.EVT_GATTS_WRITE:

View File

@ -618,7 +618,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
/// x3 = machine.Pin.board.X3 /// x3 = machine.Pin.board.X3
/// x3_af = x3.af_list() /// 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. /// pin X3.
/// ///
/// For the pyboard, x3_af would contain: /// For the pyboard, x3_af would contain:

View File

@ -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: // 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 // These can store either the value to compare against (to trigger an
// interrupt or a shortcut) or store a value returned from a // interrupt or a shortcut) or store a value returned from a
// capture/compare event. // capture/compare event.

View File

@ -29,7 +29,7 @@
/* Examples: /* Examples:
Advertisment: Advertisement:
from ubluepy import Peripheral from ubluepy import Peripheral
p = Peripheral() p = Peripheral()

View File

@ -165,7 +165,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(ubluepy_peripheral_set_conn_handler_obj, periph
#if MICROPY_PY_UBLUEPY_PERIPHERAL #if MICROPY_PY_UBLUEPY_PERIPHERAL
/// \method advertise(device_name, [service=[service1, service2, ...]], [data=bytearray], [connectable=True]) /// \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 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[] = { 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); STATIC MP_DEFINE_CONST_FUN_OBJ_KW(ubluepy_peripheral_advertise_obj, 0, peripheral_advertise);
/// \method advertise_stop() /// \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) { STATIC mp_obj_t peripheral_advertise_stop(mp_obj_t self_in) {
ubluepy_peripheral_obj_t *self = MP_OBJ_TO_PTR(self_in); ubluepy_peripheral_obj_t *self = MP_OBJ_TO_PTR(self_in);

View File

@ -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); STATIC MP_DEFINE_CONST_FUN_OBJ_1(bluepy_scan_entry_get_rssi_obj, scan_entry_get_rssi);
/// \method getScanData() /// \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) { 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); ubluepy_scan_entry_obj_t * self = MP_OBJ_TO_PTR(self_in);

View File

@ -127,7 +127,7 @@ extern const mp_obj_type_t uos_mbfs_textio_type;
// Page indexes count down from the end of ROM. // Page indexes count down from the end of ROM.
STATIC uint8_t first_page_index; STATIC uint8_t first_page_index;
STATIC uint8_t last_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; STATIC uint8_t chunks_in_file_system;
// Index of chunk to start searches. This is randomised to even out wear. // Index of chunk to start searches. This is randomised to even out wear.
STATIC uint8_t start_index; STATIC uint8_t start_index;

View File

@ -58,7 +58,7 @@
_start: _start:
b boot_entry 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. */ * microwatt. */
. = 0x10 . = 0x10
FIXUP_ENDIAN FIXUP_ENDIAN

View File

@ -6,7 +6,7 @@ SECTIONS
KEEP(*(.head)) 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. * vectors in head.S.
*/ */
. = 0x1700; . = 0x1700;

View File

@ -14,7 +14,7 @@
#define MICROPY_HW_SPI1_MOSI (15) #define MICROPY_HW_SPI1_MOSI (15)
#define MICROPY_HW_SPI1_MISO (12) #define MICROPY_HW_SPI1_MISO (12)
// Battery fuel guage MAX17048 on I2C1 // Battery fuel gauge MAX17048 on I2C1
// BATT_ALERT GPIO24 // BATT_ALERT GPIO24
// NeoPixel data GPIO8, power not toggleable // NeoPixel data GPIO8, power not toggleable

View File

@ -24,7 +24,7 @@ SUPPORTED_FN = {
def parse_pin(name_str): def parse_pin(name_str):
"""Parses a string and returns a pin number.""" """Parses a string and returns a pin number."""
if len(name_str) < 2: 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"): if not name_str.startswith("GPIO") and not name_str.startswith("EXT_GPIO"):
raise ValueError("Expecting pin name to start with EXT_/GPIO") raise ValueError("Expecting pin name to start with EXT_/GPIO")
return int(re.findall(r"\d+$", name_str)[0]) return int(re.findall(r"\d+$", name_str)[0])

View File

@ -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 /* 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 */ * FLASH ... we will include any thing excluded here in .data below by default */
*(.init) *(.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*) *(EXCLUDE_FILE(*libgcc.a: *libc.a: *lib_a-mem*.o *libm.a: *gc.c.obj *vm.c.obj *parse.c.obj) .text*)
*(.fini) *(.fini)
/* Pull all c'tors into .text */ /* Pull all c'tors into .text */

View File

@ -36,7 +36,7 @@ extern uint8_t __StackTop, __StackBottom;
void *core_state[2]; 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_entry)(void *) = NULL;
STATIC void *core1_arg = NULL; STATIC void *core1_arg = NULL;

View File

@ -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_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); 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); int id = mp_hal_get_pin_obj(args[ARG_id].u_obj);
adc_config_t adc_config = get_adc_config(id, busy_flags); adc_config_t adc_config = get_adc_config(id, busy_flags);

View File

@ -98,7 +98,7 @@ void common_i2c_irq_handler(int i2c_id) {
i2c->I2CM.INTFLAG.reg |= SERCOM_I2CM_INTFLAG_SB; i2c->I2CM.INTFLAG.reg |= SERCOM_I2CM_INTFLAG_SB;
} }
} else if (IRQ_DATA_SENT) { } 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 self->state = state_nack; // force stop of transmission
i2c->I2CM.INTFLAG.reg |= SERCOM_I2CM_INTFLAG_MB; i2c->I2CM.INTFLAG.reg |= SERCOM_I2CM_INTFLAG_MB;
} else if (self->len > 0) { // data to be sent } 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) #elif defined(MCU_SAMD51)
NVIC_EnableIRQ(SERCOM0_0_IRQn + 4 * self->id); // MB interrupt 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 + 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 #endif
// Now enable I2C. // 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; i2c->I2CM.INTENSET.reg = SERCOM_I2CM_INTENSET_MB | SERCOM_I2CM_INTENSET_SB | SERCOM_I2CM_INTENSET_ERROR;
self->state = state_busy; 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; i2c->I2CM.ADDR.bit.ADDR = (addr << 1) | READ_MODE;
// Transfer the data // Transfer the data

View File

@ -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) { } else if (request == MP_STREAM_FLUSH) {
// The timeout is defined by the buffer size and the baudrate. // 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 uint64_t timeout = mp_hal_ticks_ms_64() + (3
#if MICROPY_HW_UART_TXBUF #if MICROPY_HW_UART_TXBUF
+ self->write_buffer.size + self->write_buffer.size

View File

@ -125,14 +125,14 @@ void check_usb_recovery_mode(void) {
// Purpose of the #defines for the clock configuration. // 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 // DFLL48M is either free running, or controlled by the 32kHz crystal, or
// Synchronized with the USB clock. // Synchronized with the USB clock.
// //
// #define MICROPY_HW_XOSC32K (0 | 1) // #define MICROPY_HW_XOSC32K (0 | 1)
// //
// If MICROPY_HW_XOSC32K = 1, the 32kHz crystal is used as input for GCLK 1, which // 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. // 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. // 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 // 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. // 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 // 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. // back to a free running 48Mhz oscillator.
// //
// In all modes, the 48MHz signal has a substantial jitter, largest when // 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 // 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). // 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 // GCLK5: 48MHz, source: DFLL48M, usage: USB
// GCLK8: 1kHz, source: XOSC32K or OSCULP32K, usage: WDT and RTC // GCLK8: 1kHz, source: XOSC32K or OSCULP32K, usage: WDT and RTC
// DFLL48M: Reference sources: // 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. // from GCLK4.
// - in open loop mode: None // - in open loop mode: None
// FDPLL96M: Reference source GCLK1 // FDPLL96M: Reference source GCLK1

View File

@ -2,7 +2,7 @@
# for some of the peripheral devices with many possible assignments. # 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. # 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 # 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 # 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 # 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. # nibble. If a signal is not available, the cell in the csv table is left empty.

1 # The pin_cap_tables contain the information anbout pin mux set and pad
2 # for some of the peripheral devices with many possible assignments.
3 # The pin_cap_table is a subset from table 7-1 of the data sheet.
4 # It contain the information about pin mux set and pad
5 # The eic and adc columns contain the decimal numer for the respecitive # The eic and adc columns contain the decimal number for the respecitive
6 # quantity, the columns for sercom, tc and tcc have in each cell
7 # the device number in the upper nibble, and the pad number in the lower
8 # nibble. If a signal is not available, the cell in the csv table is left empty.

View File

@ -172,11 +172,11 @@ void check_usb_recovery_mode(void) {
// not exactly 48Mhz and has a substantional temperature drift. // 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 // 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. // back to a free running 48Mhz oscillator.
// //
// In all modes, the 48MHz signal has a substantial jitter, largest when // 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 // 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). // 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 // GCLK4: 32kHz, source: XOSC32K, if crystal present, usage: DFLL48M reference
// GCLK5: 48MHz, source: DFLL48M, usage: USB // GCLK5: 48MHz, source: DFLL48M, usage: USB
// DFLL48M: Reference sources: // 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 // - in open loop mode: None
// DPLL0: 48 - 200 MHz // DPLL0: 48 - 200 MHz

View File

@ -1,9 +1,9 @@
# The pin_cap_table is a subset from table 6-1 of the data sheet. # 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 # It contain the information about pin mux set and pad
# for some of the peripheral devices with many possible assignments. # 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. # 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 # 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 # 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. # digit. If a signal is not available, the cell in the csv table is left empty.

1 # The pin_cap_table is a subset from table 6-1 of the data sheet.
2 # It contain the information about pin mux set and pad
3 # for some of the peripheral devices with many possible assignments.
4 # 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
5 # column number is equivalent to the mux class.
6 # The eic and adc columns contain the decimal numer for the respecitive # The eic and adc columns contain the decimal number for the respecitive
7 # quantity, the columns for sercom, tc and tcc have in each cell
8 # the device number in the first, and the pad number in the second
9 # digit. If a signal is not available, the cell in the csv table is left empty.

View File

@ -121,7 +121,7 @@ const char *pin_name(int id) {
return "-"; 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 that applies return the alt_fct and pad_nr.
// If not, an error will be raised. // 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 that applies return the adc instance and channel.
// If not, an error will be raised. // 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 that applies return the alt_fct, tcc number and channel number.
// If not, an error will be raised. // If not, an error will be raised.
// The function either supplies a channel from a wanted device, or // The function either supplies a channel from a wanted device, or

View File

@ -163,7 +163,7 @@ extern struct _spi_bdev_t spi_bdev;
#define MICROPY_HW_UART7_RTS (pyb_pin_BT_RTS) #define MICROPY_HW_UART7_RTS (pyb_pin_BT_RTS)
#define MICROPY_HW_UART7_CTS (pyb_pin_BT_CTS) #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_SCL (pyb_pin_I2C1_SCL)
#define MICROPY_HW_I2C1_SDA (pyb_pin_I2C1_SDA) #define MICROPY_HW_I2C1_SDA (pyb_pin_I2C1_SDA)

Some files were not shown because too many files have changed in this diff Show More