8000 pumbaa: Pumbaa - MicroPython on Simba. by eerimoq · Pull Request #2501 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

pumbaa: Pumbaa - MicroPython on Simba. #2501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
[submodule "lib/berkeley-db-1.xx"]
path = lib/berkeley-db-1.xx
url = https://github.com/pfalcon/berkeley-db-1.xx
[submodule "pumbaa/simba"]
path = pumbaa/simba
url = https://github.com/eerimoq/simba.git
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Additional components:
- esp8266/ -- an experimental port for ESP8266 WiFi modules.
- tools/ -- various tools, including the pyboard.py module.
- examples/ -- a few example Python scripts.
- pumbaa/ -- a version of MicroPython on top of Simba

The subdirectories above may include READMEs with additional info.

Expand Down
55 changes: 55 additions & 0 deletions pumbaa/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
*.pyc
build/
TAGS
.TAGS
settings.bin
docs/_build

coverage.*

# Coverage output.
tst/*/*/amber.png
tst/*/*/emerald.png
tst/*/*/gcov.css
tst/*/*/glass.png
tst/*/*/index.html
tst/*/*/index-sort-f.html
tst/*/*/index-sort-l.html
tst/*/*/ruby.png
tst/*/*/snow.png
tst/*/*/updown.png
tst/*/*/micropython
tst/*/*/src
tst/*/*/simba
tst/*/*/tst

tst/*/amber.png
tst/*/emerald.png
tst/*/gcov.css
tst/*/glass.png
tst/*/index.html
tst/*/index-sort-f.html
tst/*/index-sort-l.html
tst/*/ruby.png
tst/*/snow.png
tst/*/updown.png
tst/*/micropython
tst/*/src
tst/*/simba
tst/*/tst

examples/*/*/amber.png
examples/*/*/emerald.png
examples/*/*/gcov.css
examples/*/*/glass.png
examples/*/*/index.html
examples/*/*/index-sort-f.html
examples/*/*/index-sort-l.html
examples/*/*/ruby.png
examples/*/*/snow.png
examples/*/*/updown.png

*.passed

pumbaa-arduino
database.json
504 changes: 504 additions & 0 deletions pumbaa/LICENSE

Large diffs are not rendered by default.

138 changes: 138 additions & 0 deletions pumbaa/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
#
# @file Makefile
#
# @section License
# Copyright (C) 2016, Erik Moqvist
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# This file is part of the Pumbaa project.
#

.PHONY: tags docs all help travis clean

PUMBAA_VERSION ?= $(shell cat VERSION.txt)

BOARD ?= linux

ifeq ($(BOARD), linux)
TESTS = \
tst/smoke \
tst/os \
tst/select \
tst/socket \
tst/thread \
tst/debug/harness \
tst/drivers/dac \
tst/drivers/exti \
tst/drivers/pin \
tst/drivers/spi \
tst/drivers/sd \
tst/kernel/timer \
tst/sync/event \
tst/sync/queue
endif

ifeq ($(BOARD), esp12e)
TESTS = \
tst/smoke
endif

ifeq ($(BOARD), arduino_due)
TESTS = \
tst/smoke
endif

all: $(TESTS:%=%.all)

clean: $(TESTS:%=%.clean)

rerun:
for test in $(TESTS) ; do \
$(MAKE) -C $$test run || exit 1 ; \
done

# Depend on 'all' to build all applications (optinally with -j) before
# uploading and running them one at a time.
run: all
for test in $(TESTS) ; do \
if [ ! -e $$test/.$(BOARD).passed ] ; then \
$(MAKE) -C $$test run || exit 1 ; \
touch $$test/.$(BOARD).passed ; \
else \
echo ; \
echo "$$test already passed." ; \
echo ; \
fi \
done

report:
for test in $(TESTS) ; do \
$(MAKE) -C $(basename $$test) report ; \
echo ; \
done

test: run
$(MAKE) report

travis:
$(MAKE) test

clean-arduino-due:
$(MAKE) BOARD=arduino_due SERIAL_PORT=/dev/simba-arduino_due clean

clean-esp12e:
$(MAKE) BOARD=esp12e SERIAL_PORT=/dev/simba-esp12e clean

test-arduino-due:
@echo "Arduino Due"
$(MAKE) BOARD=arduino_due SERIAL_PORT=/dev/simba-arduino_due test

test-esp12e:
@echo "ESP12-E"
$(MAKE) BOARD=esp12e SERIAL_PORT=/dev/simba-esp12e test

test-all-boards:
$(MAKE) test-arduino-due
$(MAKE) test-esp12e

clean-all-boards:
$(MAKE) clean-arduino-due
$(MAKE) clean-esp12e

codecov-coverage: $(TESTS:%=%.ccc)

$(TESTS:%=%.all):
$(MAKE) -C $(basename $@) all

$(TESTS:%=%.clean):
$(MAKE) -C $(basename $@) clean

$(TESTS:%=%.ccc):
$(MAKE) -C $(basename $@) codecov-coverage

docs:
+bin/dbgen.py > database.json
+bin/docgen.py database.json
$(MAKE) -C docs sphinx

tags:
echo "Creating tags file .TAGS"
etags -o .TAGS --declarations $$(find . -name "*.[hci]" | xargs)

arduino:
+make/arduino/arduino.py --remove-outdir --version $(PUMBAA_VERSION)

help:
@echo "--------------------------------------------------------------------------------"
@echo " target description"
@echo "--------------------------------------------------------------------------------"
@echo
17 changes: 17 additions & 0 deletions pumbaa/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
|buildstatus|_
|codecov|_

About
=====

`Pumbaa` is `Python` on top of `Simba`. See
http://pumbaa.readthedocs.org for further details.

The implementation is a port of `MicroPython`, designed for embedded
devices with limited amount of RAM and code memory.

.. |buildstatus| image:: https://travis-ci.org/eerimoq/pumbaa.svg
.. _buildstatus: https://travis-ci.org/eerimoq/pumbaa

.. |codecov| image:: https://codecov.io/gh/eerimoq/pumbaa/branch/master/graph/badge.svg
.. _codecov: https://codecov.io/gh/eerimoq/pumbaa
1 change: 1 addition & 0 deletions pumbaa/VERSION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
master
29 changes: 29 additions & 0 deletions pumbaa/bin/compile_ino.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python

from __future__ import print_function

import sys
import os
import subprocess
import make_frozen


def main():
ino_cpp = sys.argv[-3]
main_py = os.path.join(os.path.dirname(sys.argv[-3]), "main.py")

# Copy the .ino.cpp to main.py.
with open(main_py, "w") as fout:
with open(ino_cpp) as fin:
for line in fin:
fout.write(line)

# Generate the frozen module and write it to .ino.cpp.
frozen = make_frozen.generate_frozen([main_py])
with open(ino_cpp, "w") as fout:
fout.write(frozen)
subprocess.check_call(sys.argv[1:])


if __name__ == '__main__':
main()
Loading
0