The integration with Zephyr is fairly clean but requires us to use
two arguments to describe a pin:
drv_name - Name to be sent to device_get_binding()
pin - Pin number within the port identified by drv_name
There is support for in/out pins and pull up/pull down but currently
there is no interrupt support.
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Currently incremental build does not work because there is no
dependancy between zephyr.lnk and libmicropython.a . We fix
this is an rather brutal way by unconditionally forcing a
re-link.
Sorry!
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
This feature is not upstream yet but its very difficult to compile
micropython using the current build system (some board files include
targets that conflict with the micropython build.
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
This provides time and sleep together with the usual
ticks_us/_ms_diff and sleep_us/ms family.
We also provide access to Zephyr's high precision timer
as ticks_cycles (augmented by cycles_to_ns).
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
The boot issue text mentions a help() function and encourages
the user to run it. It is very disconcerting to find that the
function does not exist...
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Currently "make clean" clobbers the .config file, which may
contain user customization. For zephyr this is unexpected.
Normally config files are preserved during a clean and
only get removed during pristine or mrproper rules.
Fix this by making the zephyr half of the build system
responsible for tidying up the zephyr output directory.
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Allow micropython to automatically disable features that
Zephyr has been configured not to support.
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
These targets are intended to allow zephyr to ship with a
rich set of config options in prj.conf but to allow these
options to be disabled to run on especially small systems
(such as qemu_cortex_m3). The use case ends up looking
something like:
make initconfig
$ZEPHYR_BASE/scripts/config \
--file outdir/$BOARD/.config \
--disable NETWORKING --disable MBEDTLS
make oldconfig
# Check config file if needed
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
The two variables, GENERIC_TARGETS and CONFIG_TARGETS come, respectively,
from the the lists shown during "make help" and "make kconfig-help".
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Currently to compile for anything that except ARCH=x86 we have to
provide ARCH via the environment or make arguments. We can do better
than that!
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
The main zephyr build system allows BOARD to come from the environment
but the micropython pre-build does not. Fix this.
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
The fact that *now* connection closed doesn't mean there's no data in the
queue. We should process packet queue in order, and consider connection
closed only when hit corresponding state change packet (the latter requires
patches to Zephyr, because otherwise it doesn't deliver connection state
change packets to an app).
Zephyr actually filters these out, and requires patching to let them thru.
And underlying uIP uses them to e.g. communicate changes in connection
state (like peer closed connection). Without this change (and associated
Zephyr patch), socket read requests may hang if peer close happened after
read request was issued.
For this, we first build Z part with libmicropython.a not existing. This
produces autoconf.h with all setiings, but eventually fails on linking
stage due to missing libmicropython.a. We then build MicroPython, which
now can access values in autoconf.h. Then we execute Z build again, which
now succeeds.
This fixes constant substitution so that only standalone identifiers are
replaced with their constant value (if they have one). I.e. don't
replace NAME in expressions like obj.NAME or NAME = expr.