| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
| |
This is an object-oriented approach, where uos is only a proxy for the
methods on the vfs object. Some internals had to be exposed (the STATIC
keyword removed) for this to work.
Fixes #2338.
|
| |
|
|
|
|
|
|
| |
Without this, spi.read(1, 0xff) would use 16 clock cycles,
first to send 0xff and then to receive one byte, as visible
with a logic analyzer.
|
| |
|
|
|
|
|
|
| |
This updates the print function for machine.Pin to
print out the new constants from the Hardware API defintion
rather than the legacy definitions.
|
| |
|
|
|
|
|
| |
It has reliability issues and sometimes fails on Travis (reason currently
unknown).
|
| |
|
|
|
|
| |
Disable by default, enable in unix port.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
In current state `mp_get_stream_raise` assumes that `self_in` is an object
and always performs a pointer derefence which may cause a segfault.
This function shall throw an exception whenever `self_in` does not implement
a stream protocol, that includes qstr's and numbers.
fixes #2331
|
|
|
|
|
|
|
| |
In `btree_seq()`, when `__bt_seq()` gets called with invalid
`flags` argument it will return `RET_ERROR` and it won't
initialize `val`. If field `data` of uninitialized `val`
is passed to `mp_obj_new_bytes()` it causes a segfault.
|
| |
|
|
|
|
| |
TIM3 is no longer special, or at least does not have special IRQ settings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It turns out that TIM1 and TIM8 have their own Capture/Compare
interrupt vector. For all of the other timers, the capture/compare
interrupt vector is the same as the update vector.
So we need to add handlers for these vectors and enable them
when using capture/compare callbacks.
During testing of this, I also found that passing a channel callback
into the channel constructor would not enable interrupts properly.
I tested using:
```
>>> pyb.Timer(1, freq=4).channel(1, pyb.Timer.OC_TOGGLE, callback=lambda t: print('.', end=''))
```
I tested the above with channels 1, 4, and 8
|
|
|
|
| |
Disabling it was an omission from early development stages.
|
| |
|
|
|
|
|
|
| |
This module uses ESP8266's SPI hardware, which allows much higher
speeds. It uses a library from
https://github.com/MetalPhreak/ESP8266_SPI_Driver
|
|
|
|
| |
Consistently use stdint types. Fixes stmhal build.
|
| |
|
|
|
|
| |
It has reliability issues that need to be worked out.
|
|
|
|
| |
Fixes for pedantic compiler warnings.
|
| |
|
| |
|
|
|
|
| |
New API supporting stream decompression.
|
|
|
|
|
| |
These additional special methods are enabled on most ports so we can test
them in this test.
|
|
|
|
| |
The qemu-arm port is for testing, so should have features enabled.
|
| |
|
| |
|
|
|
|
| |
See issue #2264.
|
| |
|
|
|
|
|
|
| |
This type was used only for the typedef of mp_obj_t, which is now defined
by the object representation. So we can now remove this unused typedef,
to simplify the mpconfigport.h file.
|
|
|
|
|
|
|
|
|
| |
The machine_ptr_t type is long obsolete as the type of mp_obj_t is now
defined by the object representation, ie by MICROPY_OBJ_REPR. So just use
void* explicitly for the typedef of mp_obj_t.
If a port wants to use something different then they should define a new
object representation.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This patch does further refactoring using the new mp_raise_TypeError
and mp_raise_ValueError functions.
|
| |
|
|
|
|
|
|
| |
Only tuple, namedtuple and attrtuple use the tuple_cmp_helper function,
and they all have getiter=mp_obj_tuple_getiter, so the check here is only
to ensure that the self object is consistent. Hence use mp_check_self.
|
| |
|
|
|
|
| |
To use the actual current name.
|
|
|
|
|
|
| |
Checks for number of args removes where guaranteed by function descriptor,
self checking is replaced with mp_check_self(). In few cases, exception
is raised instead of assert.
|
| |
|
|
|
|
|
|
|
| |
Indended to replace raw asserts in bunch of files. Expands to empty
if MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG is defined, otehrwise by
default still to assert, though a particular port may define it to
something else.
|
|
|
|
|
|
| |
Introduce mp_raise_msg(), mp_raise_ValueError(), mp_raise_TypeError()
instead of previous pattern nlr_raise(mp_obj_new_exception_msg(...)).
Save few bytes on each call, which are many.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixing Issue #2243. Main problems were:
- HAL_ADC_GetState(adcHandle) may return other bits set (not only
HAL_ADC_STATE_EOC_REG) when called - so I AND-ed it out as proposed by
mattbrejza in Issue #2243.
- ADC Pin has to be configured as GPIO_MODE_ANALOG_ADC_CONTROL not only
GPIO_MODE_ANALOG.
- Resolved ADC resolution L4 specific (Use L4 define ADC_RESOLUTION_12B).
- Changed setting of Init.EOCSelection toADC_EOC_SINGLE_CONV for L4.
- Added call to ADC_MultiModeTypeDef as this is done on a STM32Cube
generated project too.
- Clean up: Configuration of ADC is done only in ONE function not the same
is done in two functions.
Test is done on PA5 pin of STM32L4Discovery-Kit which is connected to the
DOWN button.
Thanks to mattbrejza for discovering the bug.
|
|
|
|
|
| |
This patch introduces proper ADC Pin definitions in stm32l476_af.csv.
Originally provided by @tobbad.
|
|
|
|
|
| |
Fixes build errors such as
"../lib/utils/printf.c:43:5: error: expected parameter declarator"
|
|
|
|
|
| |
It used a standard BootROM programming algo and may be useful as a
fallback.
|
|
|
|
|
| |
The tool now generates code for freezing floats in obj-repr A, B or C,
with the specific representation detected at compile time using macros.
|