Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • flow3r/flow3r-firmware
  • Vespasian/flow3r-firmware
  • alxndr42/flow3r-firmware
  • pl/flow3r-firmware
  • Kari/flow3r-firmware
  • raimue/flow3r-firmware
  • grandchild/flow3r-firmware
  • mu5tach3/flow3r-firmware
  • Nervengift/flow3r-firmware
  • arachnist/flow3r-firmware
  • TheNewCivilian/flow3r-firmware
  • alibi/flow3r-firmware
  • manuel_v/flow3r-firmware
  • xeniter/flow3r-firmware
  • maxbachmann/flow3r-firmware
  • yGifoom/flow3r-firmware
  • istobic/flow3r-firmware
  • EiNSTeiN_/flow3r-firmware
  • gnudalf/flow3r-firmware
  • 999eagle/flow3r-firmware
  • toerb/flow3r-firmware
  • pandark/flow3r-firmware
  • teal/flow3r-firmware
  • x42/flow3r-firmware
  • alufers/flow3r-firmware
  • dos/flow3r-firmware
  • yrlf/flow3r-firmware
  • LuKaRo/flow3r-firmware
  • ThomasElRubio/flow3r-firmware
  • ai/flow3r-firmware
  • T_X/flow3r-firmware
  • highTower/flow3r-firmware
  • beanieboi/flow3r-firmware
  • Woazboat/flow3r-firmware
  • gooniesbro/flow3r-firmware
  • marvino/flow3r-firmware
  • kressnerd/flow3r-firmware
  • quazgar/flow3r-firmware
  • aoid/flow3r-firmware
  • jkj/flow3r-firmware
  • naomi/flow3r-firmware
41 results
Select Git revision
Loading items
Show changes
Showing
with 4300 additions and 0 deletions
### user input
```
button_get(button_number)
```
RETURNS state of a shoulder button (0: not pressed, -1: left, 1: right, 2: down)
`button_number` (int, range 0-1)
: 0 is right shoulder button, 1 is left shoulder button
---
```
captouch_get(petal_number)
```
RETURNS 0 if captouch petal is not touched, 1 if it is touched.
note that captouch is somewhat buggy atm.
`petal_number` (int, range 0-9)
: which petal. 0 is the top petal above the USB-C port, increments ccw.
---
```
captouch_autocalib()
```
recalibrates captouch "not touched" reference
### LEDs
```
led_set_hsv(index, hue, sat, value)
```
prepares a single LED to be set to a color with the next `leds_update()` call.
`index` (int, range 0-39)
: indicates which LED is set. 0 is above the USB-C port, increments ccw. there are 8 LEDs per top petal.
`hue` (float, range 0.0-359.0)
: hue
`val` (float, range 0.0-1.0)
: value
`sat` (float, range 0.0-1.0)
: saturation
---
```
led_set_rgb(index, hue, sat, value)
```
prepares a single LED to be set to a color with the next `leds_update()` call.
`index` (int, range 0-39)
: indicates which LED is set. 0 is above the USB-C port, increments ccw. there are 8 LEDs per top petal.
`r` (int, range 0-255)
: red
`g` (int, range 0-255)
: green
`b` (int, range 0-255)
: blue
---
```
leds_update()
```
writes LED color configuration to the actual LEDs.
### display (DEPRECATED SOON)
```
display_set_pixel(x, y, col)
```
write to a single pixel in framebuffer to be set to a color with the next `display_update()` call
`x` (int, range 0-239)
: sets x coordinate (0: right)
`y` (int, range 0-239)
: sets y coordinate (0: down)
`col` (int, range 0-65535)
: color as an rgb565 number
---
```
display_get_pixel(x, y, col)
```
RETURNS color of a single pixel from the framebuffer as an rgb565 number
`x` (int, range 0-239)
: sets x coordinate (0: right)
`y` (int, range 0-239)
: sets y coordinate (0: down)
---
```
display_fill(col)
```
writes to all pixels in framebuffer to be set to a color with the next `display_update()` call
`col` (int, range 0-65535)
: color as an rgb565 number
---
```
display_update()
```
writes framebuffer to display
import copy
import glob
import os
import os.path
import re
import shutil
def action_extensions(base_actions, project_path=os.getcwd()):
"""
Implementes -g/--generation and BADGE_GENERATION in idf.py, allowing
switching between badge generations and sdkconfig default files.
"""
# Map from canonical name to user-supported names.
GENERATIONS = {
'p1': ['proto1'],
'p3': ['proto3'],
'p4': ['proto4'],
'p5': ['adi-less'],
}
def generation_callback(ctx, global_args, tasks):
"""
Implements translation from set -g/--generation and BADGE_GENERATION
into CMake cache entries.
"""
generation = global_args.generation
if generation is None:
generation = os.environ.get('BADGE_GENERATION', 'proto4')
name = None
if generation in GENERATIONS:
name = generation
else:
for gen, names in GENERATIONS.items():
if generation in names:
name = gen
break
if name is None:
supported = []
supported += GENERATIONS.keys()
for _, names in GENERATIONS.items():
supported += names
supported = sorted(supported)
raise Exception(f'Invalid generation: want one of {", ".join(supported)}')
sdkconfig_name = 'sdkconfig.' + name
sdkconfig_path = os.path.join(project_path, sdkconfig_name)
if not os.path.exists(sdkconfig_path):
raise Exception(f'Missing sdkconfig file {sdkconfig_name}')
cache_entries = {
'SDKCONFIG_DEFAULTS': sdkconfig_path,
}
print(cache_entries)
global_args.define_cache_entry = list(global_args.define_cache_entry)
global_args.define_cache_entry.extend(['%s=%s' % (k, v) for k, v in cache_entries.items()])
# Add global options
extensions = {
'global_options': [{
'names': ['-g', '--generation'],
'help': 'Specify badge generation to build for (one of: proto1, proto3, proto4, adiless). Defaults to proto4.',
'scope': 'shared',
'multiple': False,
}],
'global_action_callbacks': [generation_callback],
'actions': {},
}
return extensions
# This copies micropython/ports/esp32/CMakeLists.txt but modifies it to remove
# the concept of 'boards' as it's not conducive to a sensible
# directory/project structure for our badge project:
#
# 1. We don't want to have stuff deeply inside micropython/ports/esp/boards.
# Ideally, the micropython directory will be a submodule that's tracking
# upstream without any modifications.
# 2. We don't want to have to call cmake with -DMICROPY_BOARD. Calling plain
# `cmake` or `idf.py` should just work and do the thing we want.
# 3. We don't target multiple boards anyways, so all that board functionality
# is just dead weight.
set(MICROPY_DIR "${PROJECT_DIR}/micropython")
set(MICROPY_PORT_DIR "${MICROPY_DIR}/ports/esp32")
set(MICROPY_QSTRDEFS_PORT "${MICROPY_PORT_DIR}/qstrdefsport.h")
include("${MICROPY_DIR}/py/py.cmake")
set(USER_C_MODULES "${PROJECT_DIR}/usermodule/micropython.cmake")
if(NOT CMAKE_BUILD_EARLY_EXPANSION)
# Enable extmod components that will be configured by extmod.cmake.
# A board may also have enabled additional components.
set(MICROPY_PY_BTREE ON)
include(${MICROPY_DIR}/py/usermod.cmake)
include(${MICROPY_DIR}/extmod/extmod.cmake)
endif()
set(MICROPY_SOURCE_SHARED
${MICROPY_DIR}/shared/readline/readline.c
${MICROPY_DIR}/shared/netutils/netutils.c
${MICROPY_DIR}/shared/timeutils/timeutils.c
${MICROPY_DIR}/shared/runtime/interrupt_char.c
${MICROPY_DIR}/shared/runtime/stdout_helpers.c
${MICROPY_DIR}/shared/runtime/sys_stdio_mphal.c
${MICROPY_DIR}/shared/runtime/pyexec.c
)
set(MICROPY_SOURCE_LIB
${MICROPY_DIR}/lib/littlefs/lfs1.c
${MICROPY_DIR}/lib/littlefs/lfs1_util.c
${MICROPY_DIR}/lib/littlefs/lfs2.c
${MICROPY_DIR}/lib/littlefs/lfs2_util.c
${MICROPY_DIR}/lib/mbedtls_errors/mp_mbedtls_errors.c
${MICROPY_DIR}/lib/oofatfs/ff.c
${MICROPY_DIR}/lib/oofatfs/ffunicode.c
)
set(MICROPY_SOURCE_DRIVERS
${MICROPY_DIR}/drivers/bus/softspi.c
${MICROPY_DIR}/drivers/dht/dht.c
)
set(MICROPY_SOURCE_PORT
${MICROPY_PORT_DIR}/main.c
${MICROPY_PORT_DIR}/uart.c
${MICROPY_PORT_DIR}/usb.c
${MICROPY_PORT_DIR}/usb_serial_jtag.c
${MICROPY_PORT_DIR}/gccollect.c
${MICROPY_PORT_DIR}/mphalport.c
${MICROPY_PORT_DIR}/fatfs_port.c
${MICROPY_PORT_DIR}/help.c
${MICROPY_PORT_DIR}/modutime.c
${MICROPY_PORT_DIR}/machine_bitstream.c
${MICROPY_PORT_DIR}/machine_timer.c
${MICROPY_PORT_DIR}/machine_pin.c
${MICROPY_PORT_DIR}/machine_touchpad.c
${MICROPY_PORT_DIR}/machine_adc.c
${MICROPY_PORT_DIR}/machine_adcblock.c
${MICROPY_PORT_DIR}/machine_dac.c
${MICROPY_PORT_DIR}/machine_i2c.c
${MICROPY_PORT_DIR}/machine_i2s.c
${MICROPY_PORT_DIR}/machine_uart.c
${MICROPY_PORT_DIR}/modmachine.c
${MICROPY_PORT_DIR}/network_common.c
${MICROPY_PORT_DIR}/network_lan.c
${MICROPY_PORT_DIR}/network_ppp.c
${MICROPY_PORT_DIR}/network_wlan.c
${MICROPY_PORT_DIR}/mpnimbleport.c
${MICROPY_PORT_DIR}/modsocket.c
${MICROPY_PORT_DIR}/modesp.c
${MICROPY_PORT_DIR}/esp32_nvs.c
${MICROPY_PORT_DIR}/esp32_partition.c
${MICROPY_PORT_DIR}/esp32_rmt.c
${MICROPY_PORT_DIR}/esp32_ulp.c
${MICROPY_PORT_DIR}/modesp32.c
${MICROPY_PORT_DIR}/machine_hw_spi.c
${MICROPY_PORT_DIR}/machine_wdt.c
${MICROPY_PORT_DIR}/mpthreadport.c
${MICROPY_PORT_DIR}/machine_rtc.c
${MICROPY_PORT_DIR}/machine_sdcard.c
)
set(MICROPY_SOURCE_QSTR
"${MICROPY_SOURCE_PY}"
"${MICROPY_SOURCE_EXTMOD}"
"${MICROPY_SOURCE_USERMOD}"
"${MICROPY_SOURCE_SHARED}"
"${MICROPY_SOURCE_LIB}"
"${MICROPY_SOURCE_PORT}"
)
set(IDF_COMPONENTS
app_update
badge23
badge23_hwconfig
bootloader_support
bt
driver
esp_adc_cal
esp_common
esp_eth
esp_event
esp_hw_support
esp_ringbuf
esp_rom
esp_pm
esp_wifi
esp_system
esp_timer
esp_netif
esp32s3
freertos
hal
heap
log
lwip
mbedtls
mdns
newlib
nvs_flash
sdmmc
soc
spi_flash
tcpip_adapter
ulp
vfs
xtensa
)
set(MICROPY_FROZEN_MANIFEST ${PROJECT_DIR}/manifest.py)
set(MICROPY_CROSS_FLAGS -march=xtensawin)
idf_component_register(
SRCS
${MICROPY_SOURCE_PY}
${MICROPY_SOURCE_EXTMOD}
${MICROPY_SOURCE_USERMOD}
${MICROPY_SOURCE_SHARED}
${MICROPY_SOURCE_LIB}
${MICROPY_SOURCE_DRIVERS}
${MICROPY_SOURCE_PORT}
INCLUDE_DIRS
# Actual micropython include paths.
${MICROPY_INC_CORE}
${MICROPY_INC_USERMOD}
${MICROPY_PORT_DIR}
# Needed for genhdr/* which for some reason is placed directly into
# the output dir. Gross.
${CMAKE_BINARY_DIR}
# Needed for include/mpconfigboard.h.
"include"
REQUIRES
${IDF_COMPONENTS}
)
# micropython machinery uses this to inspect include directories and compile
# definitions. We're effectively looping back MICROPY_{SOURCE/INC} through
# COMPONENT_TARGET (as generated by idf_component_register) back into
# micropython.
set(MICROPY_TARGET ${COMPONENT_TARGET})
# Feed information from IDF component targets into micropy qstr machinery.
foreach(comp ${IDF_COMPONENTS})
micropy_gather_target_properties(__idf_${comp})
endforeach()
# micropython/qstr wants to intern strings from nimble private headers. Tell
# them how to find them.
target_include_directories(${COMPONENT_TARGET} PUBLIC
"${IDF_PATH}/components/bt/host/nimble/nimble"
)
target_compile_definitions(${COMPONENT_TARGET} PUBLIC
# micropython includes FatFS which is configurable via its own
# configuration file, which is expected to be dfined as FFCONF_H.
# micropython also ships such a configuration file. I don't know why
# micropython doesn't just hardcode this...
FFCONF_H=\"${MICROPY_OOFATFS_DIR}/ffconf.h\"
)
include("${MICROPY_DIR}/py/mkrules.cmake")
micropython shim module
===
This is the 'main' module from ESP-IDF, and its job is to just start
micropython and continue executing `app_main` from
`components/badge23/espan.c`.
#define MICROPY_HW_BOARD_NAME "badge23"
#define MICROPY_HW_MCU_NAME "ESP32S3"
#define MICROPY_ENABLE_FINALISER (1)
#define MICROPY_PY_MACHINE_DAC (0)
#define MICROPY_HW_I2C0_SCL (9)
#define MICROPY_HW_I2C0_SDA (8)
#define MICROPY_ESP_IDF_4 1
#define MICROPY_VFS_FAT 1
#define MICROPY_VFS_LFS2 1
// These kinda freak me out, but that's what micropython does...
#define LFS1_NO_MALLOC
#define LFS1_NO_DEBUG
#define LFS1_NO_WARN
#define LFS1_NO_ERROR
#define LFS1_NO_ASSERT
#define LFS2_NO_MALLOC
#define LFS2_NO_DEBUG
#define LFS2_NO_WARN
#define LFS2_NO_ERROR
#define LFS2_NO_ASSERT
include("micropython/ports/esp32/boards")
freeze("./python_modules")
The MicroPython project was proudly and successfully crowdfunded
via a Kickstarter campaign which ended on 13th December 2013. The
project was supported by 1923 very generous backers, who pledged
for a total of 2320 pyboards.
Damien George, the project creator, is grateful to the people
listed below (and others who asked not to be named), whose support
of the project help make the code in this repository what it is
today. The names appear in order of pledging.
3 Cliff Senkbeil
4 MacDefender (http://www.macdefender.org)
11 Shaun Walker - http://theshaun.com
12 Robert Joscelyne
17 Peter Simon, Germany
18 theNetImp
21 Eamonn Maguire
22 Rob Knegjens
27 Greg, https://www.logre.eu
28 Rick S
30 Norman Jaffe (OpenDragon)
34 UltraBob was here.
35 Geoffrey R. Thompson
36 MrAtoni
40 Proud to be a backer of Micro Python, Phil C. United Kingdom.
42 www.babybadger.co.uk
45 Mert
46 Miles Cederman-Haysom
47 unixarmy.com
52 Proud to be here! Tonton Pommes
54 Espen Sae-Tang Ottersen
56 howang.hk
58 Innovatology
59 Marzsman
63 Tristan A. Hearn
64 Patrick Clarke
65 Bryan Lyon
70 Craig Burkhead
72 Dr Igor Vizir
73 Steve Iltis, @steven_iltis
79 www.giacomo.inches.ch
80 Alexander Gordeyev
81 Steve Conklin www.ai4qr.com
83 n1c0la5
84 Matthew R. Johnson
86 Jeppe Rishede
87 Kirill Zakharenko - Russian Federation
88 beltwaybureau.com
93 felix svoboda
95 Smart
96 Stephen Goudge
97 Dr Richard Whitaker, www.drrich.co.uk, UK
99 Tim Robertson
101 Rudy De Volder, www.devolder.be, Belgium
104 August H., Wien
107 Jason Hsu
109 dstensnes
110 Joe Reynolds (professorlamp)
112 Michael Davies (AU) - @butterparty @spaceduststudio
113 Jim Kirk, Westborough, MA, USA
114 yfnt
117 Even when it looks like someone is reaching for blue sky. Some days you just have to blindly support that dreamer.
118 G. Todd Vaules - todd.vaules.net
122 Gunnar Wehrhahn
124 Eric Masser
126 Vaibhav Sagar
128 Eric Wallstedt
129 Richard G Wiater
130 Toby Nance
132 Michael Fogleman
133 Snepo Research www.snepo.com Gary says Hi!
137 nic gihl
138 Felix Yuan
139 mmhanif
141 James Snyder
144 roddyr2
146 Richard Jones <http://mechanicalcat.net/richard>
147 Jon-Eric Simmons
148 Craig "The Coder" Dunn
150 Jesse S (USA)
151 Matt I. - github.com/pengii23
153 Seth Borders - sethborders.com
155 David Zemon (http://david.zemon.name)
156 Garry DuBose
157 Apeiron Systems
158 BAR
160 Jakob Hedman
163 Bryan Moffatt
165 Moises Lorenzo, Tenerife Isl.
166 Erik H.
170 Peter George
171 Nikolas Akerblom
174 Chris (@chassing)
176 Wei-Ning Huang
178 Edd Barrett, UK
179 Alec Langford
180 Shunya Sato
181 Serge GUILLAUME
183 Dr. Ross A Lumley
184 Dorian Pula
189 Tendayi Mawushe
190 SDanziger
191 Sean O'Donnell
192 Kevin McLaughlin
193 Tommy Allen
194 Beedlebub
195 Brad Howes
196 Mike B
200 Aleš Bublík
202 David Dever
206 Danilo Bargen, https://dbrgn.ch/
209 Brendan Curran-Johnson
210 Piotr Maliński http://www.rkblog.rk.edu.pl
211 SEE Co. - Science, Engineering and Education Co. - www.seeco.us
215 Richard Lancaster
218 Bilbo Baggins from Middle Zealand
219 Ollie Guy
221 Shlomo Zippel
222 Andy Kenny
223 Double-O-ren
226 For the pleasure of @tinproject
229 mfr
230 Eric Floehr
232 Matt from Adp.EU.Com
234 Joanna Tustanowska & Wojciech Bederski
235 Eric LeBlanc
236 Siggy , Belgium
238 Mauro De Giorgi
239 Belug http://belug.ca/
241 Arik Baratz - @arikb
242 Zvika Palkovich
243 Yves Dorfsman - yves at zioup dot com
244 Asad Ansari, Canada
245 Brandon Bennett
246 Christoph Bluoss
248 Konstantin Renner
249 Abtin Afshar
250 A. Soltani
251 Jon Mills
256 NoisyGecko
258 Lothilius
262 Jay Deiman
263 flo at twigs dot de
265 _Mark_ eichin at thok dot org
267 Adrian Astley
268 aknerats[::-1]
271 @robberwick
272 Daniele Lacamera
273 Thanks to M. Derome
275 Paul Paradigm, Australia
276 lyuden
277 www.SamuelJohn.de
279 John Pinner, funthyme at gmail dot com
280 Michael and Vicky Twomey-Lee
281 Kenneth Ljungqvist
292 Karin Beitins, Australia
295 Nick Johnson
297 Chris Cole U.K.
298 The planet Andete is famous for its killer edible poets.
302 Patrick B (aged 11)
304 Chris Mason, Australia
306 Steven Foster
308 Pat Fleury, Andrew Hodgson
311 @moneywithwings
313 Neil Stephen
314 Cory A. Johannsen
315 Massimo Di Stefano - geofemengineering.it - Italy
317 James Luscher, Madison, Wisconsin, USA
319 Lindsay Watt
320 Nils Fischbeck
324 Peter J. Farrell - Maestro Publishing, LLC - Minneapolis, MN, USA
325 Alex Willmer (@moreati)
328 T.R. Renicker
329 William B. Phelps
330 David Goodger
331 Viktoriya Skoryk
334 JR Rickerson
336 Keven Webb
338 www.hcfengineering.com
341 Larry Lab Rat, Shalford.
342 Rob Hetland
343 Brush Technology (NZ)
346 Jason Fehr
347 Olivier Vigneresse
348 Nano Gennari, me at nngn dot net, Brasilia, Brazil
352 Petr Viktorin (http://encukou.cz)
355 Karijn Wessing (IN2TECH)
356 Arsham Hatambeiki
358 Alvaro Rivera-Rei
360 Nolan & Theo Baldwin
362 Tyler Baker, USA
363 Russell Warren (Canada)
365 Aaron Peterson
366 Al Billings
367 Jeremy Herbert
372 Dimitrios Bogiatzoules, www.bogiatzoules.de, Germany
375 Paul Nicholls
376 Robert F. Brost
378 Aideen (Cambridge, UK) - Very happy backer and follower of this great project
379 Caelan Borowiec
380 Caroline, Canada - carolinesimpson.ca
382 Rikard Anglerud
383 Scott Will
384 Jussi Ylanen
385 @joshbapiste
387 spongefile
389 Keith Baston
392 Holger Steinlechner
394 sent by State mail service
398 N.Pearce, Wells UK - @t #ashtag UK
399 Paid up & stood back;;
401 Mike M. Tempe, AZ, USA
406 Brandon Jasper
407 Dan Mahoney
411 George Bushnell, for use in CPSS
412 Per Konradsson
413 Supported by afinzel
417 Tom Igoe
418 Jonathan Saggau
419 Chris Allick http://chrisallick.com
420 joshuaalbers.com
423 B. Adryan
432 Tim Fuchs
433 steven antalics
434 BezouwenR
435 Andrew Addison
436 Hubert de L'arrêtdubus - France
437 Salim Fadhley
438 Ben Hockley
439 Geoffrey Webb
441 Vladimir Mikulik
442 7 Elements & Troy Benjegerdes - hozer at hozed dot org
443 Pashakun
444 Craig Barnes, UK
445 Andres Ayala
446 Stonly Baptiste (urban.us)
448 Brian Conner
452 Jeremy Blum (jeremyblum.com)
454 Pebble Technology
455 Andrew
456 Jeffrey Allen Randorf, PE PhD
457 J.A.Zaratiegui a.k.a. Zara
459 simon.vc and hack.rs
462 La vida es para vivirla y ser feliz, de esa forma damos gracias por tan gran regalo!
463 Alistair Walsh
469 fun, Ireland
474 martijnthe.nl
479 Andreas Kobara
486 Armanda
487 Richard Myhill
488 Ash Gibbons
489 Glenn Franxman HackerMojo.com
492 Russell Durrett
494 Pieter Ennes
495 Tom Gross, Washington D.C.
496 Mark Schafer
497 Sandro Dutra, Brazil
500 Can Bulbul
501 Chih-Chun Chen, http://abmcet.net/Chih-Chun_Chen/home.html
502 Lost Property Bureau Ltd
503 skakz
504 Chad Cooper
505 Makhan Virdi, mlvirdi.com, InfinityXLabs.com, USA
506 Glenn Ruben Bakke, Norway
507 Alasdair Allan
509 dlbrandon
511 Dr J Garcia, Sweden
513 Tiago Vieira
518 Team ME
519 OBD Solutions (http://www.obdsol.com)
520 @pors
521 Joo Chew Ang
523 garbas
526 http://epoz.org/
527 J. Sabater
530 José-María Súnico
537 Erfundnix
538 Tontonisback Belgium
539 Greg Benson, Professor, University of San Francisco
542 Thomas Sarlandie aka @sarfata
545 JanTheMan kickstarter at embedded-systems dot craftx dot biz
546 Chuhan Frank Qin
549 Peb R Aryan, Indonesia
553 Johan Deimert, http://www.ldchome.org
555 Conny Sjöblom / Finland
558 AndyboyH, UK
559 Anthony Lupinetti
561 Travis Travelstead
566 Siegfried Boyd Isidro-Cloudas
567 G. Schroeer
568 mmths, http://randomaccessmemory.at/
570 Andy Miller - NZ..
571 Rodolfo Lara from México
572 Gary Patton Wolfe
574 Vend-lab Russia
578 Super Job! FXF
579 Oliver Heggelbacher, www.kickdrive.de
581 James Husum
585 David Lodge
587 Tess
592 PR Taylor
593 6306665119
598 Jorg Bliesener, Brazil - www.bliesener.com
602 Rodrigo, Germany
605 Tanja Kaiser, www.mrsminirobot.de, Germany
606 Franco Ponticelli - www.weblob.net
608 Piet Hoffman
609 Paul Cunnane
610 Balazs Kinszler
611 Nathan Ramella (synthesizerpatel)
612 Tyler Jones (squirly)
613 James Saffery
614 Christoffer Sjowall
615 Iman Shames
616 Thomas Dejanovic, Australia.
618 Tom Alker
619 Matt Davis, UK
621 Design for the real world! @UXnightingale
622 Budd Van Lines
624 __Gio__
628 Chew Kok Hoor
630 Santiago Alarcon, Thanks Damien for Micro Python
632 hardtoneselector
633 supported by Chris Bunker
634 Sebus - France
635 Mechanical Men Sweden
638 A Fellow Electronics Enthusiast
639 Stan Seibert
642 Dave Curtis
652 Sebastian Ross - www.ross.sx
653 Julien Goodwin
654 Reinoud de Lange, the Netherlands
655 carl beck
659 John Gaidimas
660 Tyler Eckwright
661 Keith Rome (Wintellect - http://www.wintellect.com/blogs/krome)
662 Kashev Dalmia - kashevdalmia.com
666 Alberto Martín de la Torre
667 Niels Kjøller Hansen
668 pmst - Italy
671 Sergio Conde Gómez (skgsergio)
672 Micromint, www.micromint.com
673 Xie Yanbo, China
675 Thank you
677 Kacem Ben Dhiab
679 CornishSteve
680 Daniel Wood, Warrington, UK.
682 Greg "GothAck" Miell
688 Matt Williams & Sam Carter
691 Frédéric Lasnier
694 Tim K
697 Joshua Clarke, Guernsey!
700 daynewaterlow.com
703 Scott Winder
704 @DepletionMode
707 Maria Yablonina
710 Roger Hausermann
713 Crazy_Owl
714 mike hardin usa
717 C. Towne Springer
719 ursm gruesst euch
720 madnis
727 http://itay.bazoo.org
729 @0atman
730 Jerry Gagnon
732 Emmanuel Boyer
738 suspenders
739 Roland Frédéric - http://www.creativeconvergence.be/
742 @herchu
745 Riley Lundquist
746 Go LOBOS
749 João Alves, http://jpralves.net, Portugal
751 Nick Porcino
753 Jack E. Wilkinson, Texas, USA
754 @rcarmo on Twitter/Github
758 Matt Manuel, www.mattmanuel.com
759 Padraic D. Hallinan
760 Rob Fairbairn
763 Zac Luzader
768 Sam Shams
773 terje nagel, dk
775 Luc LEGER
782 Luis M. Morales S.
785 Charles Edward Pax
786 Daryl Cumbo
787 Zephyris13
788 Wonderful project.
792 Sylvain Maziere
794 Milen
795 Robert Mai, Germany, hsapps.com
797 Angelo Compagnucci angelo.compagnucci at gmail dot com
801 Long Live Micro Python, airtripper.com
804 António M P Mendes
805 Marc Z.
809 Anoyomouse
810 in memory of Dan J. Schlacks III
817 Peter Froehlich - http://werk-schau.blogspot.com
818 Ahmad Albaqsami
821 Peter Lavelle (http://solderintheveins.co.uk)
822 Manuel Sagra de Diego http://manuelsagra.com/
823 Sam Wilson
824 Khalis
825 c't Hacks
828 Georg Bremer
830 Ward en Sanne (WenS)
832 javacasm http://www.elcacharreo.com Spain
833 mctouch
835 Bruce Schreiner @ www.stevenscollege.edu/electronics
836 Jonas
839 Nick Ludlam
840 Patrick_Law, UK
843 Alex Crouzen, UK
848 Ben Banfield-Zanin
850 Wouter Slegers, Your Creative Solutions <http://www.yourcreativesolutions.nl/>
851 Fred Zyda
853 Gianfranco Risaliti
854 Ron Hochsprung
858 Vianney Tran
862 Aaron Mahler - http://halfpress.com
868 Stephan Schulte, Germany
869 Kenneth Henderick
872 DaveP (www.davepeake.com)
873 Markus Schuss, Austria
876 Kyle Gordon, http://lodge.glasgownet.com
877 Joseph Gerard Campbell
881 Thanks for the board. Good luck to you. --Jason Doege
883 Garet McKinley
884 www.magtouchelectronics.co.za
889 Ben Johnson
896 Ruairi Newman
897 Gemma Hentsch
902 Alexander Steppke
906 Stephen Paulger
907 Martin Buhr, http://lonelycode.com, UK
912 Dale Drummond
913 Go Utah State
918 Jarturomartinez, Mexico
921 Barry Bourne Micro Python Supporter
923 Andreas Bolka
927 Thanks Susan, Tom, Paul, and Mark!
935 http://wall-y.fr
937 Eero af Heurlin, Finland, https://github.com/rambo/
938 Guillaume DAVY
941 Alexander Steffen
942 Janne "Lietu" Enberg
945 Luca 'loop' de Marinis - https://github.com/loop23
946 Andras Veres-Szentkiralyi http://techblog.vsza.hu/
948 Florian flowolf Klien (http://blog.flo.cx)
949 nickyb
951 Mark Walland, England
952 Ian Barfield
953 Andrew Murray, UK - eat my code - http://links.bloater.org/micropython
955 Kyle Howells
956 Chris Cadonic
957 LCS, USA: scripting___/||\===/||\___embedded
958 Sven Wegener
963 Kean Electronics http://www.kean.com.au/
964 Beandob
965 Don't feed the troll.
966 Alexis Polti (http://rose.eu.org)
969 Scottyler
971 The Dead's Own Jones
974 Evseev Alexey
976 Arnaud
978 Jannis Rosenbaum
980 paul at fontenworks dot com
981 John Griessen ecosensory.com USA
982 Tobias Ammann
983 Simon V.
984 JaWi
987 Ergun Kucukkose
989 Jonathan Piat France
990 Steve Pemberton
993 Aaron Robson
994 Antoine Authier
995 Thomas Winkler, Austria
997 Jannes mit dem dicken Pannes
1001 Joe Baker
1002 Jon Hylands, Canada (blog.huv.com)
1004 Mike Asker (aka mpymike)
1007 Charles V Bock - Charles at CharlesBock dot com
1010 Remember June 4th, 1989
1012 Stuart Marsden
1013 Herbert Graef, Stuttgart
1014 Arthur P, USA
1015 John Hall & Jeremy Armijo
1017 Luciano Ramalho, Python.pro.br
1018 Quentin Stafford-Fraser
1019 Marcin Walendzik Ratingpedia.eu
1020 Wincent Balin
1022 rbp
1024 Frank Carver ( www.frankcarver.me )
1026 Peter Farmer, http://geekytronics.com/
1029 Rubens Altimari
1033 Sebastian
1035 Gerli, Estonia
1036 Maurin, Switzerland
1037 Kevin Houlihan (http://crimsoncookie.com)
1039 Jon Green of Adeptium Consulting (www.adeptium.com)
1040 Eirik S. Mikkelsen
1042 Jogy Sam
1043 GGG
1045 Sean E Palmer, epimetheon.com
1049 Greg O'Drobinak, USA
1050 RaptorBird Robotics Inc
1051 Desmond Larsen-Rosner
1056 Crusty
1057 ArthurGuy.co.uk
1059 Melissa-Ivan, 14/04/2013
1064 Enrico Spinielli, https://github.com/espinielli
1066 Dave Snowdon
1067 Martin P. Hellwig
1070 Carl Clement
1074 Paul Taylor
1076 Pandemon
1082 Thrilled to support Damien's effort to put this together: there will no doubt be many applications for this effort and many enhancements and ports..
1083 Oddvar Lovaas
1090 BenScarb
1093 Www.qualnetics.com
1094 Manny Muro - Now Python can RULE from below as it does from above! PYTHON RULES!!! :)
1095 Michael Grazebrook
1098 Mark Shuttleworth, UK
1106 wyzzar
1110 Luca Zanetti
1112 Carl A Fagg
1115 Adam Klotblixt
1118 Breawn
1122 pippyisatruck
1124 Andrew "ClothBot" Plumb
1126 Realise the projects your heart beats for! Sven Wiebus (http://wiebus.tumblr.com)
1128 Citius Systems
1130 Benjamin & Reuben Fuller
1131 aglimme
1133 John Becker
1135 Mark Drummond
1138 JHProuty
1141 Lars Olsson Sweden
1144 daisuke, http://dkpyn.com
1145 Chris Pawley - http://www.pawley.co.uk/honey/
1147 Daniel from EzSBC.com
1149 New York Mortgage Exchange NYME.COM
1150 Herb Winters,USA,www.ecs87.com
1151 renttu
1159 Joe Rickerby
1160 john guthrie
1161 PUBLIC
1163 dobra-dobra
1164 Neil Reynolds, Staffordshire
1165 GEHoward
1166 Frank Delporte
1167 Bauer Brauner Enterprise
1168 Francisco Mardones
1169 Ryan Kirkpatrick, @rkirkpatnet, http://rkirkpat.net/
1170 Krister Svanlund
1174 Derek Patton Pearcy
1177 Roger Olsson, Sweden
1179 Jan-Niklas Braak
1180 Pete boy
1181 MilenX
1182 Ubbe Larsson
1183 Simon Freethy
1184 Daniel Andersson
1187 Daniele Procida
1190 Adrian Duke
1191 Pauline Middelink
1193 Ted Gueniche
1197 Craig Knott, University of Queensland, Australia
1198 Jamie Mackenzie - Australia
1199 ravenoak
1200 LucaP Luni Italy
1203 jacanterbury
1205 Bleachin, www.rhyspowell.com
1207 Supported by Andrew Maier via Kickstarter
1208 Rob, http://robjstanley.me.uk
1210 George Gingell
1213 Chris Elleman
1215 Jack Barham - @jackbarham - http://jackbarham.com
1221 Kyle Dausin
1222 Ben Lucker
1225 Gareth cheesewhisk Evans
1226 Jacob Forsyth
1227 Olof S - Germany
1231 Brasil
1233 glaslos
1234 Will Cooke - http://www.whizzy.org
1236 Andrew Wright - Canada
1239 Resourceful Robin
1240 Jay O'Neill @jayoneilluk
1241 Dennis G Daniels
1244 J. Peterson (www.saccade.com)
1245 Chipaca
1246 Nicko van Someren
1247 C. Cumbaa, Canada
1248 Gyro Gearloose was here
1249 Magnus Ericmats, Sweden
1253 Steve Wilson
1256 Adrian Bullock
1258 Sarevian & Longwall
1261 Skipp Savage
1265 Eric Nahon
1267 Stuart Dallas / 3ft9 Ltd
1270 USA
1271 Oliver
1277 jeffmcneill.com
1278 alnjxn
1283 Marc Liyanage
1285 Christian Lange
1286 Bryant Paul Umali from the Philippines
1290 W.B.Hill, Norwich, UK
1292 Michael Karliner
1293 Oli Larkin
1303 A. Pockberger
1304 dc - bagel
1305 Thadeus Arnel
1308 technoweenie
1309 Liam Welsh
1313 Per Thorell, Sweden
1314 peterlee
1316 Dustin Mierau
1317 tech-zen.tv
1320 Cheers from IDF :)
1322 www.a-d-k.de
1323 rixx
1324 @jlev
1325 e2e4
1328 Thomas J. Quinlan, London UK
1329 Don Bone
1331 Narayanamurthi
1333 PGS_Astra-ProjeX_Wilts
1337 Mark Schulz & Phillip Long, CEIT, The University of Queensland
1340 Tiegeng (Tim) Ren
1344 EMR_1344, DE
1348 Matt Ward, Nottingham
1351 Rupert
1352 Cory Li - http://cory.li
1354 Jim Davies, Brighton, UK
1355 Jon Watkins, UK
1356 Thomas, www.bitmix.de
1359 Markus Gritsch
1362 Carl H. Blomqvist
1371 Brian Green
1374 Ben Merryman
1375 O'Dea
1376 Josh Trujillo
1378 Daniel Halloran
1379 another_martin
1383 Thanks for innovating!
1385 CoderDojo Malahide
1397 Jacob Z
1398 Staffan Hillberg
1399 http://kim.ht
1402 Can't wait to plug it in!
1403 Márton Szinovszki
1405 sellorm says 'Hi!'
1406 Thomas Provoost
1411 Clive Freeman
1412 Norman Thomas
1415 Javier Llopis
1417 Ho Man Fai
1418 Anders Helland
1421 Richard lavanture
1425 Alan Churley, UK
1426 Robert'); DROP TABLE Students;--unicode is fun!
1427 Go Illini!
1430 MicroPy FTW
1431 Bryan Morrissey, www.browninnovations.com
1436 Krzysztof Chomski, Poland
1437 WellAware (USA)
1441 Tomas Hau
1443 Paul Way
1444 Benjamin Anderson
1445 Andrew Bates
1446 Davide Di Blasi
1451 Mathias Fischer
1453 Drexore, NL
1454 Marek Mroz
1455 Mark Easley Jr. - USA
1457 Joshua Warren
1459 Rohan Menon
1460 Paul Sokolovsky
1461 Chris Foresman, @foresmac
1475 USI
1478 Chris Emerson
1479 Ph. Truillet, France, http://www.irit.fr/~Philippe.Truillet
1480 WAB3
1481 Lucidologia.pl
1482 Ed Hardebeck | www.hardebeck.us
1484 Ludovic Léau-Mercier, www.coriolys.org, France
1487 BLUEBOBO
1488 Berno Kneer, Germany
1491 Julian Eccli
1494 Batman
1495 Manuel Núñez Sánchez
1496 Millie and Sadie Smith
1499 Ronald Eddy
1500 SynShop Las Vegas
1503 This is really cool. - Jack Conway
1505 Victor Suarez, Argentina
1507 Renesas Electronics America
1509 Team
1513 A. Lamborn KD0ZFY
1514 olifink
1520 mike at sustainable-opportunities dot com
1521 luis almeida, Teresina - Brazil
1523 Muhammad Jamaludin
1524 Sdlion
1525 Charles Rogers
1526 Diego M. Aires, Brazil
1529 muwatt.com
1532 Proud supporter of microPython
1535 Jesus J. de Felipe
1536 slminneman.com -- Wow, an acknowledgement? ...really?
1538 Mike (Meski) Smith
1541 Piero Steinger
1545 Alex Rembish (https://rembish.org)
1551 Sergey [BuG2BuG] Sobko, Russia
1553 Serge Krier
1556 Luuk Derksen
1561 Jimmy Caille (CH)
1562 Jesús Leganés Combarro "piranna"
1564 Viacheslav Olegovich Savitskiy
1565 Jamie Whitehorn
1567 Bagge Carlson
1568 Milan Cermak
1569 Matthias Lemp
1570 BOFG
1571 Johan Elmerfjord, Sweden
1573 Matt Finch • fnch.io
1574 Jean-Francois Paris
1575 Florian Franzen, Germany
1576 doganowscy.com
1579 Stan Yamane
1580 William Cirillo
1583 David Dibben
1584 Nicolás, Amelia, Luli y alecu
1586 Alex W
1591 Livia Maria Dias Tavares
1593 d freymann chicago il & his australian shepherd jaldi
1594 Barnstorm Studio, LLC
1595 Sashi Penta
1597 tflhyl
1598 clacktronics
1599 j3hyde
1600 Rik Williams
1602 Valeriy Van, Ukraine, w7software.com
1603 Louis Taylor - https://github.com/kragniz
1606 What's the derivative of (6.022 x 10^23)x? That's A(n)mol
1611 Bailey & Brayden Yoong Policarpio
1613 William Bettridge-Radford
1617 Urbane Jackson
1618 Henius
1622 Alister Galpin, New Zealand
1623 Marco Bertoldi
1627 Julian Pistorius
1628 www.neotral.com
1632 ChrisB
1633 Norbini
1634 Eric Rand at Brownhatsecurity.com
1636 Benjamin Eberle
1637 MG Projects bvba, Geert Maertens, Belgium
1640 Robson dos Santos França (Brasil)
1642 Udine
1643 Simon Critchley
1644 Sven Haiges, Germany
1646 "silicium" ("silicium_one", if "silicium" is busy)
1648 Andy O'Malia, @andyomalia
1650 RedCamelApps.com
1652 Christoph Heer
1653 AlisonW
1654 Yannick Allard (Belgium) supported this project.
1655 Andy Pointon, UK
1660 Diego Cantalapiedra
1664 Pepillou
1670 Sonny Cannon
1671 Rick W
1672 David Chan, USA
1674 Philip Rowlands
1675 dieresys
1676 T.R. Fullhart
1683 Oleg Sidorkin
1686 Tatsuro Yasukawa
1687 Brad Smith, Somerville MA, USA
1688 kristoffervikhansen.com
1690 Nice Project de W6AKB Alan Biocca
1691 Hiss Hisss Hissss Hiss Hiss Hissssssss
1692 Alan Kennedy
1698 ElChessu
1701 Flower Craswell
1702 David Fontenot
1707 To innovation & creativity. Tony J Winter
1708 Joakim Hentula
1711 Michael Schaefer
1713 Brody Radford ~ www.brodyradford.com
1714 Charles Durrant
1715 Rodrigo S.
1718 Dima Shylo
1719 Jiahao James Jian
1722 Helen Wilson, Christ's Hospital
1726 Martin Aule, http://hackest.org/
1727 İsmail Etem Tezcan, Rasteda
1728 Charlie "Blackfrog" Sizer
1729 Matloob Qureshi
1730 Travis Saul http://travissaul.com
1731 Michael Cavins
1733 Peter Köllensperger, Norway
1734 Anne Harrison
1736 Peter Bradeen
1739 Fredrik Luthander
1740 Nick LaRosa
1744 Aladuino
1745 dgrebb
1746 Truls Unstad
1748 Jesus Saves
1750 Andy Stannard (@rockmonkey)
1751 Daniel Atkinson
1755 John Potter
1758 Ian V
1760 David Leinbach
1761 nemec-automation.com
1765 Supported by JoW with Hardwired TCP/IP from www.WIZnet.eu
1767 misskniss, Boise Idaho. It is our responsibility to code the freedom we want to see in the world.
1768 Jeff Vahue - Knowlogic Software Corp.
1769 Pat Molloy
1770 Greg Maxwell gregmaxwell-at-mac-dot-com
1771 Rich Robinson
1773 Ken Corey @ flippinbits.com
1782 Acknowledged
1785 Optimized Tomfoolery
1791 Nontakan Nuntachit, Thailand
1794 Rasit Eskicioglu - Canada
1795 Simon Elliston Ball
1796 pfh
1798 John W. C. McNabb
1799 Frank Sanborn
1803 Morgan Hough
1804 Sorcha Bowler
1805 http://www.WayneKeenan.info
1806 HBEE, hbee.eu
1807 Deadlight
1809 www.danenet.org
1811 Sergey Nebolsin
1813 Threv
1817 dynsne
1818 David Wright
1819 John Warren
1821 I wanted Erlang! (╯°□°)╯︵ ┻━┻
1825 Howard R Hansen
1828 Kevin Schumacher
1833 Matthias Erll, Sweden
1836 Matt Graham
1837 thedawn
1838 Ruby Feinstein
1839 Gustavo Muñoz (timbergus)
1840 Ian Paczek
1841 Köteles Károly, Hungary
1843 Tobias Sette Ferreira
1846 x4FF3 <3 microPython
1847 Enrico Faulhaber (Germany)
1850 jolan00
1854 Red Harbinger Inc
1855 Noman
1858 @DerLinkshaender
1863 Jon Woodcock
1864 Elmo, hakkerikartano.fi
1865 Imaginals
1866 Sam Hathaway and Rachel Stevens
1874 Remo Sanges, SZN, Italy
1875 Devraj Mukherjee
1876 an Embedded fan
1877 Peter Huisers
1878 Kin-Wai Lee (Malaysia)
1879 Samuel Hawksby-Robinson
1881 R. Stock
1886 Randy of Capistrano street backed Damien's MicroPython!
1887 Rogério Bulha Siqueira - www.esd-talk.com - Brazil
1889 NickE is happy to support such a worthy project!
1892 John Boudreaux
1894 Riverfreeloader
1895 Jose Marcelino http://metavurt.net
1896 T Britto-Borges
1899 DannyWhitsonUSA
1904 José Iván Ferrer Ruiz.
1905 Tom Loredo
1906 Gregory Perry USA
1908 josephoberholtzer.com
1910 Michael Klos, USA
1912 Adam Mildenberger
1913 R Anderson
1914 Nikesh, USA
1915 Bogdan Chivoiu, Romania
1916 Scott C. Lemon, USA
1918 Konstantin Ufimtsev (@KestL)
1919 Benny Khoo
1922 Nicci Tofts
1925 Joshua Coxwell
1926 Franklin Hamilton
1928 Peter Korcz
1929 Leroy Douglas
1930 A ナルと fan from Nigeria who likes smileys, here's one for good measure :)
1931 Kimmo Lahtinen, Finland
1932 http://staybles.co.uk
1937 The Olivetti's: Emanuele Laura Nausicaa Sibilla Ettore
1940 Pascal Hirsch
1942 cbernander, Sweden
1944 Enrico M.
1947 Dinis Cruz
1949 Jonathan Greig, http://embroidermodder.github.io
1950 Andy Bower
1952 Gerard Hickey
1953 Fabrice BARRAL was here ...
1955 Pieter Röhling
1957 uomorando, Italy
1959 Acacio Cruz
The MicroPython project raised further funds through a second
Kickstarter campaign that was primarily targeted at porting the
code to the ESP8266 WiFi chip. The campaign ended on 2nd March
2016 and gained the support of 1384 fantastic backers who believed
in the project and the principles of Open Source code. Those
backers who asked to be named are listed below, with an asterisk
indicating that they also supported the first campaign.
* 1 Gabriel, Seattle
* 2 @robberwick
* 6 Dave Hylands
7 Les, UK
8 Ryanteck LTD., UK
10 karlsruhe, HU
* 11 Turbinenreiter
13 Ben Nuttall, UK
* 14 Bryan Morrissey, MA, USA
* 15 Jogy, Qatar
* 16 BOB63,IT
19 ReaBoyd
* 20 Andrew, MK
* 21 chrisq, NO
22 Pascal RENOU, France
23 Javier G, ES
25 Forrest, US
26 Filip Korling, Sweden
27 roberthh - Rhineland
* 28 Herbert Graef, Stuttgart, thanking the MicroPython Team for this great project
* 29 johnsonfamily38, UK
30 CympleCy
31 OJ, PK
32 Daniel, SVK
33 Shabaz Mohammad
* 35 Kenneth Henderick, BE
* 37 Daniel Mouritzen, DK
39 Torntrousers, UK
* 44 Scanner
45 Radomir Dopieralski
46 Nick, UK
* 47 Jon Hylands, Canada
* 48 Ben Barwise Clacktronics
50 Rob Kent, UK
52 Carlos Pereira Atencio
54 Andy, UK
* 55 WMinarik, Canada
57 Hauffe, Germany
58 HyperTaz, IT
* 61 Michael Kovacs, AT
62 Erick Navarro, PE
69 Karan,US
* 71 Nick B, UK
* 72 Anthony Lister, NZ
* 73 Bryan Lyon
76 Miguel Angel Ajo, ES
* 78 Sebastian, Regensburg (GER)
* 80 iv3unm
81 Thierry BÉNET, FR
84 Jannis, Germany
86 Nathan Jeffrey
88 Cory Benfield, UK
90 Carlo, IT
* 91 Wojciech Bederski (@wuub)
92 Steve Holden, UK
93 Tristan Roddis, UK
94 Balder, Sweden
* 95 Rhys, UK
96 Rowan, UK
* 97 Gary Martin, Edinburgh
* 100 Mikael Eiman
* 101 torwag
* 102 Craig Barnes, UK
103 Andrea Grandi, UK
105 Piers, UK
* 109 Wayne Keenan
110 makuk66
111 Hamine,DZ
112 Arahavica,JP
* 113 Bill Eubanks, USA
114 Jonathan, UK
115 ghickman
* 117 Christian Lange, Germany
119 Jonty Wareing
121 TheHetman
123 Víctor R. Ruiz, Spain
* 124 Laurynas Paukste, Norway
* 125 Taki
126 André Milette, Canada
* 127 Ron Cromberge,NL
128 IJ, Thailand
* 130 IGOR VIZIR
132 Bill Saturno
134 scibi
136 Timbo, AU
137 Raphael Vogel, DE
* 139 jasonkirk, US
141 Linköping, Sweden
* 142 Dugres
144 DarioS, UK
146 NelisW
* 148 _Mark_
* 149 Folke Berglund, Sweden
150 Deniz Dag/Belgium
152 Jacques Thomas
153 Dag Henrik, Norway
* 154 Alexander Steppke
158 stavros.io
* 161 Seong-Woo Kim, KR
162 Aaron H, Seattle
164 Iwan, CZ
165 Jenning, DE
167 Oliver Z, Germany
* 168 Chris Mason, Australia
169 Fabio P. Italy
171 Jonathan, Ireland
173 Philipp B., DE
174 Mancho, IT
175 Mikkel Sørensen, DK
176 Raphael Lullis
* 177 Tim, China
179 JasperS, NL
180 Scott, AU
181 Roland Kay, UK
182 Adam Baxter
184 Hugo Herter
185 Simon AM, Malta
186 Leif Denby
190 Maxious
* 192 Guido, GER
* 193 Pierre Rousseau, Canada
195 Pete Hinch
* 198 KoalaBear,USA. TRUMPED 2016!
* 200 Pimoroni, UK
201 jpwsutton, UK
203 Felix, Sweden
204 Dmitri Don, Tallinn Estonia
205 PeteDemiSwede, UK
* 207 Serge GUILLAUME
208 Gurtubay, ES
209 Geir-Olav, NO
210 RayDeo, Germany
215 DIYAbility
216 Josef Dunbar, USA
* 217 Enrico, BE/IT
219 Damian Moore, UK
220 Wayne and Layne, LLC
221 The Old Crow, USA
224 Hackscribble, UK
* 225 Alex March, UK
226 @rdslw
227 Mike, Canada
* 228 Adrian Smith
229 Dinu Gherman, Germany
230 Tinamous.com
* 231 Nikesh, US
* 232 chrisallick.com
234 Daniel Von Fange
* 235 Michal Muhlpachr, CZ
* 236 Petr Viktorin
237 Ryan Aldredge
238 Patrik Wallström, SE
* 239 MobiusNexus
240 Stray, US
* 241 BOFG, no
244 Issac Kelly
* 247 David Prime
249 James Marsh, UK
* 250 BezouwenR
252 Avinash Magdum, India
253 Greg Abbas, Menlo Park CA
254 Jorge, ES
256 JohanP, swe
* 258 Ben Doan
259 Jan van Haarst, NL
* 263 JoshT, Los Angeles
264 cstuder, Switzerland
266 Jon Armani
* 270 Liam Welsh
271 Jason Peacock
272 Alejandro Lopez
275 Dan O'Donovan, UK
276 N1TWC
277 Roland Tanglao, Vancouver
278 Twpsyn
280 Robert, ME-US
* 282 Thomas, UK
283 Jeff Schroeder, USA
284 Paulus Schoutsen
* 287 Neon22, NZ
290 kbmeister
291 Gary Hahn
292 Dave Matsumoto, USA
296 Sam Lee, SG
304 Poul Borg, Denmark
307 MightyPork
308 Dale
* 312 Anton Kraft, Germany
315 Kism3t, UK
317 NateM
* 318 N&T, Calvijn Meerpaal, NL
322 Andreas Monitzer
323 Rikard, SE
328 Olaf, DE
* 329 John Boudreaux
330 DOCE, Germany
331 feilipu
332 Stefan Schwetschke
333 Wayneji, NZ
337 Alain de Lamirande, Canada
338 Hori, TW
340 Azmodie, UK
341 Lygon, UK
* 342 JRM in STL, USA
344 R Colistete-Jr., BR
* 345 ChristianG, DE
347 Nis Sarup, DK.
350 Nickedynick
351 Dazza, Oz
352 lispmeister, NL
355 Tomas Lubkowitz, SE
357 Mark, UK
* 358 Team ME
363 Papahabla
364 Greg Chevalley
365 Maic Striepe, Germany
369 Ian McMahon
371 A. DARGA, Fr
372 Ernesto Maranesi, BR
373 Steve Lyon
374 James Cloos
375 Bas Zeppenfeldt, The Netherlands
378 Pycom Ltd
380 Wade Christensen, USA
382 Justin Wing Chung Hui, UK
383 C Paulson
384 Ian Tickle
386 Danny, Seattle
388 Erik Moe, Chicago, IL
* 389 Eric B. Wertz, USA
390 Michael. CH
391 Christopher Baughman
392 James Churchill
393 Rob, DC
395 Whee Min, Singapore
* 396 Jason Doege, TX
401 MrFish
403 Thejesh GN
404 Markus, Sweden
405 AMR, Spain
407 Svet, ES
* 408 Thoralt, Germany
409 Emil, Sweden
410 David Moloney, ireland
411 Marco S, DE
415 Peter W., Austria
417 emendo A/S
* 419 Kalestis, Switzerland
421 Ondra, CZ
422 Elheffe
423 thinkl33t, UK
424 TonyF
425 Herr Robert Linder, PA, USA
* 426 Anders Astrom S(E|G)
* 428 Jussi Ylanen, CT, USA
431 Neil H., USA
434 Rod Perez, MX
435 Carol, US
436 Gina Haeussge, DE
438 Weilinger, GER
* 439 Ron Ward, Australia
441 Rex, UT, USA
* 444 Slush, CZ
445 Bruce, Florida
* 448 Patrick Di Justo
449 ScubaBearLA
450 Mike Causer, Sydney AU
451 Joel Fries, USA
* 452 Andrew Bernstein, US
454 EAS, Seattle, WA, USA
* 456 Christopher J. Morrone, USA
* 457 Anthony Gilley, Sweden
458 Andre Breiler, DE
* 460 Fuffkin, UK
* 461 adent, CZ
462 Samuel Pickard
463 Mirko, Germany
* 464 Ramin/US
465 Mike, Grenoble
466 Rolf, DE
* 467 Dave Haynes
* 469 Mac Ha, Vietnam
* 470 Enno, DE
* 473 Smudo, DE
* 474 Duncan, Scotland
475 Chris, UK
476 Peter Groen, NL
478 Gertjan Geerling, Nijmegen
* 479 Benjamin Eberle
* 480 Mechanical Men Sweden
* 482 Rémi de Chazelles, FR
483 mager, Bremen
484 jurekh, NL
* 485 Craig Burkhead
487 JohanHartman, SouthAfrica
* 489 Viktor, NL
491 Jean-Denis Carre
492 Jesse, Canada
493 Alex C. MacDonald, USA
* 494 GustavoV, MX
495 Sebastian, Berlin
497 Bernard, Feluy
* 500 Ron H, USA
501 Gregg "Cabe" Bond, UK
502 Colin, NI
504 Robin, USA
* 507 pkropf
* 510 6LhasaCo Canada
511 Tom Sepe, USA
513 Andrew McKenna
515 tom46037
516 G2, USA
* 517 Pauline Middelink, NL
* 518 Brush Technology, Ltd
520 Pierre Meyitang, USA
521 Stephanie Maks, Canada
526 John McClain
* 527 Sigadore, US
528 Richard Hudspeth, US
530 Martin, Austria
531 Stephen Eaton, Australia
* 533 RJCE, UK
535 Teiste, Finland
536 Pio, UK
537 DirtyHarry, DE
* 540 Dom G. UK
* 541 Nial, UK
543 Andreas, AUT
545 WisdomWolf
* 549 MrMx,ES
552 Daniel Soto, Landscape.
554 Claus Fischer, DK
557 Aleksi Määttä
560 Justin Wilcott, USA
562 LoneTone, UK
567 Cameron, US
568 Dirck, Germany
569 Michael Keirnan
571 Harry, CN
* 572 Ward Wouts
573 Dan Anaya, USA
574 Ben Bennett
575 nirvana2165, US
576 PDG, BZH
* 581 Visit, Thailand
582 John Carr, UK
* 583 Klankschap
587 jacky,FR
588 JD Marsters
591 Ryan Jarvis, US
595 Claudio Hediger, CH
* 597 Bambam, Sweden
598 Timothé, FR
* 599 Luís Manuel, Portugal
601 Eric, DE
602 Olaf, Cambridge, UK
* 603 Tim, Dubai
604 Tyndell, US
606 Ciellt AB, SE
607 Ömer Boratav
609 Guy Molinari, US
614 Freek Dijkstra
615 Carlos Camargo CO
616 Michael Nemecky, Norway
618 Ovidiu G.
619 arobg, USA
* 621 Geoff Shilling, US
623 EliotB, NZ
624 slos UK
625 Montreal, CA
* 626 Peter Korcz
627 Kodi
628 Jim, Valdosta, USA
629 Sander Boele, NL
630 Max Lupo
631 Daniel.B, Newcastle Australia
632 Andrés Suárez García, Vigo (Spain)
633 Rens, NL
634 Max Petrich, DE
635 Fabian Affolter, CH
636 Cadair
* 637 Mike Karliner
638 Daniel T, UK
639 Mark Campbell, UK
640 James S, Australia
641 PBTX!
* 642 amaza,SP
644 se4mus
* 645 Alexander Steffen
* 647 Jim Richards Maine, USA
649 Doug D, US
650 Keaton Walker
* 651 Scott Winder, USA
653 Jeff Fischer, USA
654 Andrej Mosat
655 Mohd Faizal Mansor, Malaysia
657 Mike "Cutter" Shievitz, US
* 658 Daniel Andersson, SE
659 Alexander, NL
660 François, CH
* 661 AndrewS, UK
662 Denisae, PT
663 KC8KZN
664 Angelo, Wales
665 BlueberryE, Germany
667 fvlmurat
668 Adam Wilson
675 Ulrich Norbisrath (http://ulno.net)
676 Daniel, Portland OR
* 677 Andreas Lindquist, SE
680 Jason, NL
682 lapawa, GER
683 John Batty, UK
685 Addy, Netherlands
686 Marc, CA
690 APapantonatos
691 gmorell, US
* 692 Jamie Mackenzie, Adelaide, SA
* 693 Dave Dean, US
697 woojay, US
698 Webabot, NY
* 699 Jason Fehr, Canada
700 Hadi (AU)
* 701 Abraham Arce
* 703 Must Be Art
712 Thanks for the great work!/datax-holding/Stuttgart
* 714 Thomas Pr., BE
715 Black Country Atelier BCA
718 Don W, Arlington VA
721 Xavier C. (EU)
722 Chad P. Lung, U.S.A
726 Alexander Lash (@lexlash)
727 Sven, MX
728 Terence, PL
* 730 Mauro De Giorgi, USA
735 Jay Ward, Canada
736 Fabian Topfstedt, AT
739 sjoerdDOTcom
740 David, Australia
743 Michael Niewiera, Germany
745 cbenhagen
746 berserck, CH
748 Lars Hansson, Sweden
750 Landrash
751 Richard B., CT USA
752 Neil Chandler, UK
* 753 John Griessen US
* 755 Caminiti, Mexico
757 Mikael Trieb, Sweden
760 S1GM9, MX
761 Dave C, US
* 763 Su Zhou, China
765 Caitlyn - USA
769 Will, NZ
770 CJB,UK
771 Victor Claessen, NL
772 Antal, CH
773 Tokyo, Japan
* 774 Join Business & Technology AB, Sweden
777 Overspeed Innovation
* 778 Bruce, Chanute KS
779 TOPALIS, RO
780 klaas2
781 Matthias Schmitz, Berlin
783 Jan Studený wishes "Python everywhere"
788 Ian, USA
789 Mark K, UK
791 DerFlob, Germany
792 Staffan Johansson, Sweden
793 Stefan W., DE
795 Mark S. Harris, Small Dog Electronics
796 Kittikun, TH
* 798 aerialist, Japan
799 Sweta
* 800 Mark Shuttleworth
802 Kim Thostrup
803 Andy Fundinger
810 Matt Vallevand, Detroit MI
813 Jim McDonald
816 Rob Dobson
817 Rafał Zieliński, PL
* 818 Shaun Walker, AUS
819 Timothy R, Belgium
820 clem
825 JuanB, ES
826 Randall Gaz, Colorado USA
827 Dick van Ginkel, The Netherlands
829 Jan-Pieter Van Impe
831 David Kirkpatrick, AU
832 Ravi Teja, India
833 AkosLukacs, HU
834 Dave Desson, CAN
837 LWQ.CZ, CZ
838 Robert W., Issaquah, WA
839 Daniel Hrynczenko
840 Martin Filtenborg, DK
841 InnHuchen, Ger
845 Raju Pillai,India
847 cfus/DE
* 851 Juli H.
853 David Monterroso Cabello , SP
857 24x8, LLC, US
860 Sebastian, DE
861 pajusmar
864 Ronnie, UK
* 867 Travis Travelstead, USA
* 870 Woodat, US/UK
872 Gary Bake, UK
873 Ernesto Martinez
* 874 Scottt, USA
876 Ronnie Kizzle, LA
880 Harish, Singapore
882 Wacht, Pittsburgh
883 PatrickF, US
886 Paolo, IT
888 Defragster
889 Rachel Rayns, UK
* 890 Peak Data LLC
891 Mindwarp, AU
892 Vincent Smedley, UK
* 894 Bailey & Brayden
898 Jacek Artymiak, UK
900 John Hudson, USA
* 901 ReneS, NL
* 902 B Stevens
903 Cptnslick, US
904 janlj@me.com
905 Fabricio Biazzotto
906 Lenz Hirsch
907 SerSher, RU
908 Florian, DE
909 Mathias Svendsen, DK
* 910 Jeremiah Dey-Oh
911 Allan Joseph Medwick
913 Matt, Australia
914 Christian Pedersen
* 915 SPIN
916 Denis M., Russia
917 Ahmed Alboori, Saudi Arabia
918 Luciano, Italy
919 Ragdehl
* 921 Artur, HU
922 Greg, NC - USA
924 Gurzixo
* 927 Gregg, Oregon
928 cwschroeder, BY
929 W. Bush - NY, USA.
932 ddparker
933 Enkion
* 934 Eric G. Barron
936 thomasDOTwtf
940 mifous, cucurbitae.eu
942 VFL68, FR
943 Casey, Hong Kong
* 945 Kean Electronics
946 Nima, UK
947 Klosinski, USA
948 PieWiE, NL
* 949 Rui Carmo, PT
* 950 basbrun.com
951 Aashu, UK
* 952 vk2nq - Brian
954 gojimmypi
955 Jack, USA
* 957 @SteveBattle
* 958 Beshr, Sweden
962 PeterR, UK
964 Russell Calbert
965 LAurent_B, Fr
967 Qazi, USA
971 Jonas, FR
973 PK Shiu
* 974 sea_kev
976 Radhika, USA
977 Chris Gibson, US
* 978 Mike, AU
* 979 Geeky Pete
981 Timmy the wonderdog
983 An Ostler it IT
984 Frank Ray Robles
985 Kurtsik
987 Johan, SE
988 NJBerland, Norway
992 Leon Noel - @leonnoel
994 Kjell, SE
995 boriskourt
997 Bartek B., CANADA
999 Thomas Wiradikusuma, Indonesia
1000 Trey, NOLA
1002 Jori, FI
1005 nmmarkin
1006 Mattias Fornander
1007 Panayot Daskalov, Bulgaria
*1009 AndyP, UK
1011 TSD
1013 Chris, Berlin
1017 Gareth Edwards, UK
1018 Trixam,DE
1019 César from Makespace Madrid, Spain
1020 Prajwal, Australia
*1024 Fred Dart - FTDI
1025 bsx
*1026 Regis, FR
1027 Adrian Hill
1029 Alice, UK
1030 Erkan Shakir, BG
1031 Alexander, EE
1033 Patric, Luxembourg
1034 For my beloved mother, Colleen Clancy.
1035 NigelB
1037 François, Aus/Fr
*1039 Thanura Siribaddana, Australia
1041 Harald, USA
1042 Jeremy Utting, NZ
1043 bejuryu, KR
*1044 Daniel Wood, UK
1046 C. J. Blocker
*1047 Rodrigo Benenson, Germany
1048 Håvard Gulldahl
1049 SeB, Belgium
1054 Ryan Miller, Austin TX
1055 Gianluca Cancelmi
1057 Francesco, IT
1058 RockTractor!
1060 Bill G., Atlanta GA USA
1061 joenotjoe
1064 ATrivedi, USA
1067 Jim Chandler, UK
1068 Aria Sabeti
1069 Noah Rosamilia, USA
1070 GAKgDavid, CA
1072 Markus, Austria
*1073 Tarwin, MUC
*1077 Balazs Kinszler, HU
*1080 pfh
*1082 Ovidiu Hossu, SG
*1083 mmhanif, NJ
*1084 Wincent Balin, DE
*1086 Anatoly Verkhovsky
*1087 Greg, Plano
*1089 Angelo Compagnucci
1090 Ryan Shaw (ryannathans), AU
1092 Dries007, BE
*1093 Dave Snowdon, UK
*1094 halfpress
*1096 DeuxVis, FR
*1097 Your Creative Solutions
1099 Emanuele Goldoni, IT
*1100 Tendayi Mawushe
1101 Rob, Tikitere
*1102 SolidStateSoul
*1103 Michael, GER
*1106 Paul, San Francisco
*1107 Oddvar Lovaas
*1108 Doc Savage, Man of Bronze
1109 Stijn Debrouwere
1111 Ark Nieckarz, USA
*1112 ECS87.com, USA
*1114 Gary P. Wolfe, USA
1117 Tom Hodson
*1118 @arikb (twitter)
1123 Piotr Gryko UK
*1125 Cantalaweb, Spain
1126 Edward of Clovis
1127 Jim G
*1128 billbr, Loveland, CO, USA
1129 dalanmiller
*1130 StephenH, UK
*1132 Thomas Sarlandie - @sarfata
1133 Doug Rohm, US
*1134 Eric Floehr, Ohio, USA
*1135 Sven Haiges
1136 relix42
*1137 Ralf Nyren
*1138 nickgb
1139 zwack, DE
1140 Michal B., PL
1141 Matt, Australia
1143 slv, Mi2
1144 Pawel, CH
*1145 James Saffery
*1147 nekomatic
*1149 @nt1, Earth
*1150 Alister Galpin, NZ
1151 Jayemel, UK
1152 Koalabs
1153 James Myatt, UK
*1154 DanS, Norway
1155 Sandeep, US
*1156 Anil Kavipurapu
*1158 Frederik Werner, DE
1160 Erik J, Canada
1164 bluezebra, Ireland
1168 Birk, DE
1169 Gabi, FR
*1173 mliberty, USA
1174 Jamie Smith, Scotland
1175 Sebastian, Germany
*1176 John Cooper, UK
1177 Moritz, DE
1178 Kevin, DE
*1179 Ming Leung, Canada
1180 Laird Popkin
1181 tasmaniac, GA
*1183 RichardW, UK
*1187 Thomas Quinlan, London, UK
1188 LGnap, BE
*1189 bloater, Edinburgh UK
1192 pakt, SE
1194 Sandsmark, NO
*1195 Gert Menke
1197 Emsi88, SK
1199 GTtronics HK Ltd.
1200 Jo, Bergen
*1202 MarkS, Australia
1203 Igor, HR
1204 Lord Nightmare
1205 Great Uncle Bulgaria, UK
*1206 salomonderossi
1208 Master_Ipse, DE
1209 Luis G.F, ES
1211 Harald, FO
*1212 Kimmo, Finland
*1213 P. Perreijn, Netherlands
1214 jcea, Spain
1215 simon holmes à court
1217 Bill M, Newcastle
*1218 snowball
*1221 Georges, CDN
1222 JPLa
1225 Erik Gullberg, Sweden
1226 Matthias Fuchs, IN, Germany
1229 Majed, CA
1230 Michiel, Reeuwijk
1231 Clive, Essex UK
1232 Jan Kalina, CZ
1234 MBBest, Australia
*1235 Reinoud de Lange, NL
1237 Jeffrey Park, South Korea
1238 David Olson
1239 Nathan Battan
1240 Marcus, TW
1241 randyrrt, USA
1242 Holger, Germany
1243 Dmitri Chapkine, FRANCE
1244 Ceyhun Kapucu, TR
1245 Hong Kong
*1246 gPozo, US
1247 Peter M, Sweden
*1249 Duncan, Cambridge
*1251 Schaeferling, DE
1252 Christian Prior, DE
*1256 ovig
1257 Kerry Channing, UK
1258 Exception42, GER
*1259 nchalikias
1261 Kittie, US
1263 Alex, Norway
1264 wats0n, TW
*1265 Henner
*1266 Mike M, AZ, USA
1268 Bobby Ly, USA
*1269 Espen STO, Norway
1270 arduware.cc
1274 Christopher Flynn, NH USA
*1275 Bruce Boyes, USA
1276 DCH
1278 McGinkel, Netherlands
1279 Dieter, Wien
1280 R. Tummers, NL
1283 Pranav Maddula, USA
1286 Dusan, SLovakia
1290 Stephen Youndt
*1291 Lertsenem, FR
1292 NuclearTide, London
1293 Ben Gift, USA
1294 rmg
1295 jmaybe, USA
1296 Allan G, Georgia
1297 Duncan Brassington, UK
1300 Hans, NL
1301 Valerio "valdez" Paolini, IT
1303 Neotreat, DE
1306 tomtoump
1307 Edward B Cox, England
1310 Oliver Steele
1311 merps, AUS
1313 n8henrie, USA
*1314 YGA-KSD n7/ULB, FR-BE
1317 Adrian, Romania
*1318 Luca "Loop", ITA
*1319 Michael Twomey, Ireland
1321 Trey Aughenbaugh
1322 Marcel Hecko, SK
1323 Hugo Neira, CL
1326 JH, US
*1330 Luthander, SE
1331 Rickard Dahlstrand, Sweden
1333 Olivier M., France
1334 DWVL, UK
1335 MRZANE, Sweden
1336 Benedikt, DE
*1338 Tiegeng, US
*1339 arthoo Eindhoven Nederland
1340 Magnus Gustavsson, Sweden
1341 Jan Bednařík
1344 Mike McGary: US
1346 mp3tobi
*1350 Cyberhippy
1351 Sandro, PT
1355 Kwabena W. Agyeman
1357 Ryan Young
*1358 Chiang Mai, Thailand
1359 AKLitman, USA
1360 JASK Enterprises, Ltd-John
*1361 Tom Gidden, UK
1362 AdamT, USA
1363 Jose de la Campa, BOL
1365 Steve Laguna, U.S.A
*1368 Walrusklasse, NL
1370 Timofei Korostelev, Belarus
1374 Janos,HU
*1375 Paul Cunnane
1377 IanE, UK
1378 Hans, NL
1379 Jose Angel Jimenez Vadillo, Spain
*1380 PaulT, Lancs
1383 Lutz; DE
1385 AnRkey
1387 Fredrik, FIN
1388 Matt W (funkyHat)
1389 Zeev Rotshtein, Israel
1391 joostd, NL
1392 Lukasz Blaszczyk, USA
*1397 Wei-Ning Huang, TW
1398 myu
*1399 Thorsten, Germany
1401 sm0ihr
1403 Xiaotian, Seattle US
*1406 -gt-, Czech Republic
1407 Mike Y. Diallo, US
1409 ubii, US
Git commit conventions
======================
Each commit message should start with a directory or full file path
prefix, so it was clear which part of codebase a commit affects. If
a change affects one file, it's better to use path to a file. If it
affects few files in a subdirectory, using subdirectory as a prefix
is ok. For longish paths, it's acceptable to drop intermediate
components, which still should provide good context of a change.
It's also ok to drop file extensions.
Besides prefix, first line of a commit message should describe a
change clearly and to the point, and be a grammatical sentence with
final full stop. First line should fit within 72 characters. Examples
of good first line of commit messages:
py/objstr: Add splitlines() method.
py: Rename FOO to BAR.
docs/machine: Fix typo in reset() description.
ports: Switch to use lib/foo instead of duplicated code.
After the first line add an empty line and in the following lines describe
the change in a detail, if needed, with lines fitting within 75 characters
(with an exception for long items like URLs which cannot be broken). Any
change beyond 5 lines would likely require such detailed description.
To get good practical examples of good commits and their messages, browse
the `git log` of the project.
When committing you are encouraged to sign-off your commit by adding
"Signed-off-by" lines and similar, eg using "git commit -s". If you don't
explicitly sign-off in this way then the commit message, which includes your
name and email address in the "Author" line, implies your sign-off. In either
case, of explicit or implicit sign-off, you are certifying and signing off
against the following:
* That you wrote the change yourself, or took it from a project with
a compatible license (in the latter case the commit message, and possibly
source code should provide reference where the implementation was taken
from and give credit to the original author, as required by the license).
* That you are allowed to release these changes to an open-source project
(for example, changes done during paid work for a third party may require
explicit approval from that third party).
* That you (or your employer) agree to release the changes under
MicroPython's license, which is the MIT license. Note that you retain
copyright for your changes (for smaller changes, the commit message
conveys your copyright; if you make significant changes to a particular
source module, you're welcome to add your name to the file header).
* Your contribution including commit message will be publicly and
indefinitely available for anyone to access, including redistribution
under the terms of the project's license.
* Your signature for all of the above, which is the "Signed-off-by" line
or the "Author" line in the commit message, includes your full real name and
a valid and active email address by which you can be contacted in the
foreseeable future.
Code auto-formatting
====================
Both C and Python code are auto-formatted using the `tools/codeformat.py`
script. This uses [uncrustify](https://github.com/uncrustify/uncrustify) to
format C code and [black](https://github.com/psf/black) to format Python code.
After making changes, and before committing, run this tool to reformat your
changes to the correct style. Without arguments this tool will reformat all
source code (and may take some time to run). Otherwise pass as arguments to
the tool the files that changed and it will only reformat those.
uncrustify
==========
Only [uncrustify](https://github.com/uncrustify/uncrustify) v0.71 or v0.72 can
be used for MicroPython. Different uncrustify versions produce slightly
different formatting, and the configuration file formats are often
incompatible. v0.73 or newer *will not work*.
Depending on your operating system version, it may be possible to install a pre-compiled
uncrustify version:
Ubuntu, Debian
--------------
Ubuntu versions 21.10 or 22.04LTS, and Debian versions bullseye or bookworm all
include v0.72 so can be installed directly:
```
$ apt install uncrustify
```
Arch Linux
----------
The current Arch uncrustify version is too new. There is an [old Arch package
for v0.72](https://archive.archlinux.org/packages/u/uncrustify/) that can be
installed from the Arch Linux archive ([more
information](https://wiki.archlinux.org/title/Downgrading_packages#Arch_Linux_Archive)). Use
the [IgnorePkg feature](https://wiki.archlinux.org/title/Pacman#Skip_package_from_being_upgraded)
to prevent it re-updating.
Brew
----
This command may work, please raise a new Issue if it doesn't:
```
curl -L https://github.com/Homebrew/homebrew-core/raw/2b07d8192623365078a8b855a164ebcdf81494a6/Formula/uncrustify.rb > uncrustify.rb && brew install uncrustify.rb && rm uncrustify.rb
```
Automatic Pre-Commit Hooks
==========================
To have code formatting and commit message conventions automatically checked,
a configuration file is provided for the [pre-commit](https://pre-commit.com/)
tool.
First install `pre-commit`, either from your system package manager or via
`pip`. When installing `pre-commit` via pip, it is recommended to use a
virtual environment. Other sources, such as Brew are also available, see
[the docs](https://pre-commit.com/index.html#install) for details.
```
$ apt install pre-commit # Ubuntu, Debian
$ pacman -Sy python-precommit # Arch Linux
$ brew install pre-commit # Brew
$ pip install pre-commit # PyPI
```
Next, install [uncrustify (see above)](#uncrustify). Other dependencies are managed by
pre-commit automatically, but uncrustify needs to be installed and available on
the PATH.
Then, inside the MicroPython repository, register the git hooks for pre-commit
by running:
```
$ pre-commit install --hook-type pre-commit --hook-type commit-msg
```
pre-commit will now automatically run during `git commit` for both code and
commit message formatting.
The same formatting checks will be run by CI for any Pull Request submitted to
MicroPython. Pre-commit allows you to see any failure more quickly, and in many
cases will automatically correct it in your local working copy.
To unregister `pre-commit` from your MicroPython repository, run:
```
$ pre-commit uninstall --hook-type pre-commit --hook-type commit-msg
```
Tips:
* To skip pre-commit checks on a single commit, use `git commit -n` (for
`--no-verify`).
* To ignore the pre-commit message format check temporarily, start the commit
message subject line with "WIP" (for "Work In Progress").
Python code conventions
=======================
Python code follows [PEP 8](https://legacy.python.org/dev/peps/pep-0008/) and
is auto-formatted using [black](https://github.com/psf/black) with a line-length
of 99 characters.
Naming conventions:
- Module names are short and all lowercase; eg pyb, stm.
- Class names are CamelCase, with abbreviations all uppercase; eg I2C, not
I2c.
- Function and method names are all lowercase with words separated by
a single underscore as necessary to improve readability; eg mem_read.
- Constants are all uppercase with words separated by a single underscore;
eg GPIO_IDR.
C code conventions
==================
C code is auto-formatted using [uncrustify](https://github.com/uncrustify/uncrustify)
and the corresponding configuration file `tools/uncrustify.cfg`, with a few
minor fix-ups applied by `tools/codeformat.py`. When writing new C code please
adhere to the existing style and use `tools/codeformat.py` to check any changes.
The main conventions, and things not enforceable via the auto-formatter, are
described below.
White space:
- Expand tabs to 4 spaces.
- Don't leave trailing whitespace at the end of a line.
- For control blocks (if, for, while), put 1 space between the
keyword and the opening parenthesis.
- Put 1 space after a comma, and 1 space around operators.
Braces:
- Use braces for all blocks, even no-line and single-line pieces of
code.
- Put opening braces on the end of the line it belongs to, not on
a new line.
- For else-statements, put the else on the same line as the previous
closing brace.
Header files:
- Header files should be protected from multiple inclusion with #if
directives. See an existing header for naming convention.
Names:
- Use underscore_case, not camelCase for all names.
- Use CAPS_WITH_UNDERSCORE for enums and macros.
- When defining a type use underscore_case and put '_t' after it.
Integer types: MicroPython runs on 16, 32, and 64 bit machines, so it's
important to use the correctly-sized (and signed) integer types. The
general guidelines are:
- For most cases use mp_int_t for signed and mp_uint_t for unsigned
integer values. These are guaranteed to be machine-word sized and
therefore big enough to hold the value from a MicroPython small-int
object.
- Use size_t for things that count bytes / sizes of objects.
- You can use int/uint, but remember that they may be 16-bits wide.
- If in doubt, use mp_int_t/mp_uint_t.
Comments:
- Be concise and only write comments for things that are not obvious.
- Use `// ` prefix, NOT `/* ... */`. No extra fluff.
Memory allocation:
- Use m_new, m_renew, m_del (and friends) to allocate and free heap memory.
These macros are defined in py/misc.h.
Examples
--------
Braces, spaces, names and comments:
#define TO_ADD (123)
// This function will always recurse indefinitely and is only used to show
// coding style
int foo_function(int x, int some_value) {
if (x < some_value) {
foo(some_value, x);
} else {
foo(x + TO_ADD, some_value - 1);
}
for (int my_counter = 0; my_counter < x; ++my_counter) {
}
}
Type declarations:
typedef struct _my_struct_t {
int member;
void *data;
} my_struct_t;
Documentation conventions
=========================
MicroPython generally follows CPython in documentation process and
conventions. reStructuredText syntax is used for the documention.
Specific conventions/suggestions:
* Use `*` markup to refer to arguments of a function, e.g.:
```
.. method:: poll.unregister(obj)
Unregister *obj* from polling.
```
* Use following syntax for cross-references/cross-links:
```
:func:`foo` - function foo in current module
:func:`module1.foo` - function foo in module "module1"
(similarly for other referent types)
:class:`Foo` - class Foo
:meth:`Class.method1` - method1 in Class
:meth:`~Class.method1` - method1 in Class, but rendered just as "method1()",
not "Class.method1()"
:meth:`title <method1>` - reference method1, but render as "title" (use only
if really needed)
:mod:`module1` - module module1
`symbol` - generic xref syntax which can replace any of the above in case
the xref is unambiguous. If there's ambiguity, there will be a warning
during docs generation, which need to be fixed using one of the syntaxes
above
```
* Cross-referencing arbitrary locations
~~~
.. _xref_target:
Normal non-indented text.
This is :ref:`reference <xref_target>`.
(If xref target is followed by section title, can be just
:ref:`xref_target`).
~~~
* Linking to external URL:
```
`link text <http://foo.com/...>`_
```
* Referencing builtin singleton objects:
```
``None``, ``True``, ``False``
```
* Use following syntax to create common description for more than one element:
~~~
.. function:: foo(x)
bar(y)
Description common to foo() and bar().
~~~
More detailed guides and quickrefs:
* http://www.sphinx-doc.org/en/stable/rest.html
* http://www.sphinx-doc.org/en/stable/markup/inline.html
* http://docutils.sourceforge.net/docs/user/rst/quickref.html
MicroPython Code of Conduct
===========================
The MicroPython community is made up of members from around the globe with a
diverse set of skills, personalities, and experiences. It is through these
differences that our community experiences great successes and continued growth.
When you're working with members of the community, this Code of Conduct will
help steer your interactions and keep MicroPython a positive, successful, and
growing community.
Members of the MicroPython community are open, considerate, and respectful.
Behaviours that reinforce these values contribute to a positive environment, and
include: acknowledging time and effort, being respectful of differing viewpoints
and experiences, gracefully accepting constructive criticism, and using
welcoming and inclusive language.
Every member of our community has the right to have their identity respected.
The MicroPython community is dedicated to providing a positive experience for
everyone, regardless of age, gender identity and expression, sexual orientation,
disability, physical appearance, body size, ethnicity, nationality, race, or
religion (or lack thereof), education, or socio-economic status.
Unacceptable behaviour includes: harassment, trolling, deliberate intimidation,
violent threats or language directed against another person; insults, put downs,
or jokes that are based upon stereotypes, that are exclusionary, or that hold
others up for ridicule; unwelcome sexual attention or advances; sustained
disruption of community discussions; publishing others' private information
without explicit permission; and other conduct that is inappropriate for a
professional audience including people of many different backgrounds.
This code of conduct covers all online and offline presence related to the
MicroPython project, including GitHub and the forum. If a participant engages
in behaviour that violates this code of conduct, the MicroPython team may take
action as they deem appropriate, including warning the offender or expulsion
from the community. Community members asked to stop any inappropriate behaviour
are expected to comply immediately.
Thank you for helping make this a welcoming, friendly community for everyone.
If you believe that someone is violating the code of conduct, or have any other
concerns, please contact a member of the MicroPython team by emailing
contact@micropython.org.
License
-------
This Code of Conduct is licensed under the Creative Commons
Attribution-ShareAlike 3.0 Unported License.
Attributions
------------
Based on the Python code of conduct found at https://www.python.org/psf/conduct/
When reporting an issue and especially submitting a pull request, please
make sure that you are acquainted with Contributor Guidelines:
https://github.com/micropython/micropython/wiki/ContributorGuidelines
as well as the Code Conventions, which includes details of how to commit:
https://github.com/micropython/micropython/blob/master/CODECONVENTIONS.md
The MIT License (MIT)
Copyright (c) 2013-2022 Damien P. George
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
--------------------------------------------------------------------------------
Unless specified otherwise (see below), the above license and copyright applies
to all files in this repository.
Individual files may include additional copyright holders.
The various ports of MicroPython may include third-party software that is
licensed under different terms. These licenses are summarised in the tree
below, please refer to these files and directories for further license and
copyright information. Note that (L)GPL-licensed code listed below is only
used during the build process and is not part of the compiled source code.
/ (MIT)
/drivers
/cc3100 (BSD-3-clause)
/wiznet5k (BSD-3-clause)
/lib
/asf4 (Apache-2.0)
/axtls (BSD-3-clause)
/config
/scripts
/config (GPL-2.0-or-later)
/Rules.mak (GPL-2.0)
/berkeley-db-1xx (BSD-4-clause)
/btstack (See btstack/LICENSE)
/cmsis (BSD-3-clause)
/crypto-algorithms (NONE)
/libhydrogen (ISC)
/littlefs (BSD-3-clause)
/lwip (BSD-3-clause)
/mynewt-nimble (Apache-2.0)
/nrfx (BSD-3-clause)
/nxp_driver (BSD-3-Clause)
/oofatfs (BSD-1-clause)
/pico-sdk (BSD-3-clause)
/re15 (BSD-3-clause)
/stm32lib (BSD-3-clause)
/tinytest (BSD-3-clause)
/tinyusb (MIT)
/uzlib (Zlib)
/logo (uses OFL-1.1)
/ports
/cc3200
/hal (BSD-3-clause)
/simplelink (BSD-3-clause)
/FreeRTOS (GPL-2.0 with FreeRTOS exception)
/stm32
/usbd*.c (MCD-ST Liberty SW License Agreement V2)
/stm32_it.* (MIT + BSD-3-clause)
/system_stm32*.c (MIT + BSD-3-clause)
/boards
/startup_stm32*.s (BSD-3-clause)
/*/stm32*.h (BSD-3-clause)
/usbdev (MCD-ST Liberty SW License Agreement V2)
/usbhost (MCD-ST Liberty SW License Agreement V2)
/teensy
/core (PJRC.COM)
/zephyr
/src (Apache-2.0)
/tools
/dfu.py (LGPL-3.0-only)
[![CI badge](https://github.com/micropython/micropython/workflows/unix%20port/badge.svg)](https://github.com/micropython/micropython/actions?query=branch%3Amaster+event%3Apush) [![codecov](https://codecov.io/gh/micropython/micropython/branch/master/graph/badge.svg?token=I92PfD05sD)](https://codecov.io/gh/micropython/micropython)
The MicroPython project
=======================
<p align="center">
<img src="https://raw.githubusercontent.com/micropython/micropython/master/logo/upython-with-micro.jpg" alt="MicroPython Logo"/>
</p>
This is the MicroPython project, which aims to put an implementation
of Python 3.x on microcontrollers and small embedded systems.
You can find the official website at [micropython.org](http://www.micropython.org).
WARNING: this project is in beta stage and is subject to changes of the
code-base, including project-wide name changes and API changes.
MicroPython implements the entire Python 3.4 syntax (including exceptions,
`with`, `yield from`, etc., and additionally `async`/`await` keywords from
Python 3.5 and some select features from later versions). The following core
datatypes are provided: `str`(including basic Unicode support), `bytes`,
`bytearray`, `tuple`, `list`, `dict`, `set`, `frozenset`, `array.array`,
`collections.namedtuple`, classes and instances. Builtin modules include
`os`, `sys`, `time`, `re`, and `struct`, etc. Select ports have support for
`_thread` module (multithreading), `socket` and `ssl` for networking, and
`asyncio`. Note that only a subset of Python 3 functionality is implemented
for the data types and modules.
MicroPython can execute scripts in textual source form (.py files) or from
precompiled bytecode (.mpy files), in both cases either from an on-device
filesystem or "frozen" into the MicroPython executable.
MicroPython also provides a set of MicroPython-specific modules to access
hardware-specific functionality and peripherals such as GPIO, Timers, ADC,
DAC, PWM, SPI, I2C, CAN, Bluetooth, and USB.
Getting started
---------------
See the [online documentation](https://docs.micropython.org/) for API
references and information about using MicroPython and information about how
it is implemented.
We use [GitHub Discussions](https://github.com/micropython/micropython/discussions)
as our forum, and [Discord](https://discord.gg/RB8HZSAExQ) for chat. These
are great places to ask questions and advice from the community or to discuss your
MicroPython-based projects.
For bugs and feature requests, please [raise an issue](https://github.com/micropython/micropython/issues/new/choose)
and follow the templates there.
For information about the [MicroPython pyboard](https://store.micropython.org/pyb-features),
the officially supported board from the
[original Kickstarter campaign](https://www.kickstarter.com/projects/214379695/micro-python-python-for-microcontrollers),
see the [schematics and pinouts](http://github.com/micropython/pyboard) and
[documentation](https://docs.micropython.org/en/latest/pyboard/quickref.html).
Contributing
------------
MicroPython is an open-source project and welcomes contributions. To be
productive, please be sure to follow the
[Contributors' Guidelines](https://github.com/micropython/micropython/wiki/ContributorGuidelines)
and the [Code Conventions](https://github.com/micropython/micropython/blob/master/CODECONVENTIONS.md).
Note that MicroPython is licenced under the MIT license, and all contributions
should follow this license.
About this repository
---------------------
This repository contains the following components:
- [py/](py/) -- the core Python implementation, including compiler, runtime, and
core library.
- [mpy-cross/](mpy-cross/) -- the MicroPython cross-compiler which is used to turn scripts
into precompiled bytecode.
- [ports/](ports/) -- platform-specific code for the various ports and architectures that MicroPython runs on.
- [lib/](lib/) -- submodules for external dependencies.
- [tests/](tests/) -- test framework and test scripts.
- [docs/](docs/) -- user documentation in Sphinx reStructuredText format. This is used to generate the [online documentation](http://docs.micropython.org).
- [extmod/](extmod/) -- additional (non-core) modules implemented in C.
- [tools/](tools/) -- various tools, including the pyboard.py module.
- [examples/](examples/) -- a few example Python scripts.
"make" is used to build the components, or "gmake" on BSD-based systems.
You will also need bash, gcc, and Python 3.3+ available as the command `python3`
(if your system only has Python 2.7 then invoke make with the additional option
`PYTHON=python2`). Some ports (rp2 and esp32) additionally use CMake.
Supported platforms & architectures
-----------------------------------
MicroPython runs on a wide range of microcontrollers, as well as on Unix-like
(including Linux, BSD, macOS, WSL) and Windows systems.
Microcontroller targets can be as small as 256kiB flash + 16kiB RAM, although
devices with at least 512kiB flash + 128kiB RAM allow a much more
full-featured experience.
The [Unix](ports/unix) and [Windows](ports/windows) ports allow both
development and testing of MicroPython itself, as well as providing
lightweight alternative to CPython on these platforms (in particular on
embedded Linux systems).
The ["minimal"](ports/minimal) port provides an example of a very basic
MicroPython port and can be compiled as both a standalone Linux binary as
well as for ARM Cortex M4. Start with this if you want to port MicroPython to
another microcontroller. Additionally the ["bare-arm"](ports/bare-arm) port
is an example of the absolute minimum configuration, and is used to keep
track of the code size of the core runtime and VM.
In addition, the following ports are provided in this repository:
- [cc3200](ports/cc3200) -- Texas Instruments CC3200 (including PyCom WiPy).
- [esp32](ports/esp32) -- Espressif ESP32 SoC (including ESP32S2, ESP32S3, ESP32C3).
- [esp8266](ports/esp8266) -- Espressif ESP8266 SoC.
- [mimxrt](ports/mimxrt) -- NXP m.iMX RT (including Teensy 4.x).
- [nrf](ports/nrf) -- Nordic Semiconductor nRF51 and nRF52.
- [pic16bit](ports/pic16bit) -- Microchip PIC 16-bit.
- [powerpc](ports/powerpc) -- IBM PowerPC (including Microwatt)
- [qemu-arm](ports/qemu-arm) -- QEMU-based emulated target, for testing)
- [renesas-ra](ports/renesas-ra) -- Renesas RA family.
- [rp2](ports/rp2) -- Raspberry Pi RP2040 (including Pico and Pico W).
- [samd](ports/samd) -- Microchip (formerly Atmel) SAMD21 and SAMD51.
- [stm32](ports/stm32) -- STMicroelectronics STM32 family (including F0, F4, F7, G0, G4, H7, L0, L4, WB)
- [teensy](ports/teensy) -- Teensy 3.x.
- [webassembly](ports/webassembly) -- Emscripten port targeting browsers and NodeJS.
- [zephyr](ports/zephyr) -- Zephyr RTOS.
The MicroPython cross-compiler, mpy-cross
-----------------------------------------
Most ports require the [MicroPython cross-compiler](mpy-cross) to be built
first. This program, called mpy-cross, is used to pre-compile Python scripts
to .mpy files which can then be included (frozen) into the
firmware/executable for a port. To build mpy-cross use:
$ cd mpy-cross
$ make
External dependencies
---------------------
The core MicroPython VM and runtime has no external dependencies, but a given
port might depend on third-party drivers or vendor HALs. This repository
includes [several submodules](lib/) linking to these external dependencies.
Before compiling a given port, use
$ cd ports/name
$ make submodules
to ensure that all required submodules are initialised.
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
PYTHON = python3
SPHINXOPTS = -W --keep-going -j auto
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build/$(MICROPY_PORT)
CPYDIFFDIR = ../tools
CPYDIFF = gen-cpydiff.py
GENRSTDIR = genrst
# Run "make FORCE= ..." to avoid rebuilding from scratch (and risk
# producing incorrect docs).
FORCE = -E
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " cpydiff to generate the MicroPython differences from CPython"
clean:
rm -rf $(BUILDDIR)/*
rm -f $(GENRSTDIR)/*
cpydiff:
@echo "Generating MicroPython Differences."
rm -f $(GENRSTDIR)/*
cd $(CPYDIFFDIR) && $(PYTHON) $(CPYDIFF)
html: cpydiff
$(SPHINXBUILD) $(FORCE) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/MicroPython.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/MicroPython.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/MicroPython"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/MicroPython"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex: cpydiff
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf: cpydiff
$(SPHINXBUILD) $(FORCE) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
latexpdfja: cpydiff
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
MicroPython Documentation
=========================
The MicroPython documentation can be found at:
http://docs.micropython.org/en/latest/
The documentation you see there is generated from the files in the docs tree:
https://github.com/micropython/micropython/tree/master/docs
Building the documentation locally
----------------------------------
If you're making changes to the documentation, you may want to build the
documentation locally so that you can preview your changes.
Install Sphinx, and optionally (for the RTD-styling), sphinx_rtd_theme,
preferably in a virtualenv:
pip install sphinx
pip install sphinx_rtd_theme
In `micropython/docs`, build the docs:
make html
You'll find the index page at `micropython/docs/build/html/index.html`.
Having readthedocs.org build the documentation
----------------------------------------------
If you would like to have docs for forks/branches hosted on GitHub, GitLab or
BitBucket an alternative to building the docs locally is to sign up for a free
https://readthedocs.org account. The rough steps to follow are:
1. sign-up for an account, unless you already have one
2. in your account settings: add GitHub as a connected service (assuming
you have forked this repo on github)
3. in your account projects: import your forked/cloned micropython repository
into readthedocs
4. in the project's versions: add the branches you are developing on or
for which you'd like readthedocs to auto-generate docs whenever you
push a change
PDF manual generation
---------------------
This can be achieved with:
make latexpdf
but requires a rather complete install of LaTeX with various extensions. On
Debian/Ubuntu, try (1GB+ download):
apt install texlive-latex-recommended texlive-latex-extra texlive-xetex texlive-fonts-extra cm-super xindy
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# MicroPython documentation build configuration file, created by
# sphinx-quickstart on Sun Sep 21 11:42:03 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('.'))
# The members of the html_context dict are available inside topindex.html
micropy_version = os.getenv('MICROPY_VERSION') or 'latest'
micropy_all_versions = (os.getenv('MICROPY_ALL_VERSIONS') or 'latest').split(',')
url_pattern = '%s/en/%%s' % (os.getenv('MICROPY_URL_PREFIX') or '/',)
html_context = {
'cur_version':micropy_version,
'all_versions':[
(ver, url_pattern % ver) for ver in micropy_all_versions
],
'downloads':[
('PDF', url_pattern % micropy_version + '/micropython-docs.pdf'),
],
'is_release': micropy_version != 'latest',
}
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'MicroPython'
copyright = '- The MicroPython Documentation is Copyright © 2014-2022, Damien P. George, Paul Sokolovsky, and contributors'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# We don't follow "The short X.Y version" vs "The full version, including alpha/beta/rc tags"
# breakdown, so use the same version identifier for both to avoid confusion.
version = release = micropy_version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['build', '.venv']
# The reST default role (used for this markup: `text`) to use for all
# documents.
default_role = 'any'
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
# Global include files. Sphinx docs suggest using rst_epilog in preference
# of rst_prolog, so we follow. Absolute paths below mean "from the base
# of the doctree".
rst_epilog = """
.. include:: /templates/replace.inc
"""
# -- Options for HTML output ----------------------------------------------
# on_rtd is whether we are on readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd: # only import and set the theme if we're building docs locally
try:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.']
except:
html_theme = 'default'
html_theme_path = ['.']
else:
html_theme_path = ['.']
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = ['.']
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = '../../logo/trans-logo.png'
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
html_favicon = 'static/favicon.ico'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['static']
# Add a custom CSS file for HTML generation
html_css_files = [
'custom.css',
]
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%d %b %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
html_additional_pages = {"index": "topindex.html"}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'MicroPythondoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
# Include 3 levels of headers in PDF ToC
'preamble': '\setcounter{tocdepth}{2}',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'MicroPython.tex', 'MicroPython Documentation',
'Damien P. George, Paul Sokolovsky, and contributors', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# Enable better Unicode support so that `make latexpdf` doesn't fail
latex_engine = "xelatex"
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'micropython', 'MicroPython Documentation',
['Damien P. George, Paul Sokolovsky, and contributors'], 1),
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'MicroPython', 'MicroPython Documentation',
'Damien P. George, Paul Sokolovsky, and contributors', 'MicroPython', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'python': ('https://docs.python.org/3.5', None)}
.. _cmodules:
MicroPython external C modules
==============================
When developing modules for use with MicroPython you may find you run into
limitations with the Python environment, often due to an inability to access
certain hardware resources or Python speed limitations.
If your limitations can't be resolved with suggestions in :ref:`speed_python`,
writing some or all of your module in C (and/or C++ if implemented for your port)
is a viable option.
If your module is designed to access or work with commonly available
hardware or libraries please consider implementing it inside the MicroPython
source tree alongside similar modules and submitting it as a pull request.
If however you're targeting obscure or proprietary systems it may make
more sense to keep this external to the main MicroPython repository.
This chapter describes how to compile such external modules into the
MicroPython executable or firmware image. Both Make and CMake build
tools are supported, and when writing an external module it's a good idea to
add the build files for both of these tools so the module can be used on all
ports. But when compiling a particular port you will only need to use one
method of building, either Make or CMake.
An alternative approach is to use :ref:`natmod` which allows writing custom C
code that is placed in a .mpy file, which can be imported dynamically in to
a running MicroPython system without the need to recompile the main firmware.
Structure of an external C module
---------------------------------
A MicroPython user C module is a directory with the following files:
* ``*.c`` / ``*.cpp`` / ``*.h`` source code files for your module.
These will typically include the low level functionality being implemented and
the MicroPython binding functions to expose the functions and module(s).
Currently the best reference for writing these functions/modules is
to find similar modules within the MicroPython tree and use them as examples.
* ``micropython.mk`` contains the Makefile fragment for this module.
``$(USERMOD_DIR)`` is available in ``micropython.mk`` as the path to your
module directory. As it's redefined for each c module, is should be expanded
in your ``micropython.mk`` to a local make variable,
eg ``EXAMPLE_MOD_DIR := $(USERMOD_DIR)``
Your ``micropython.mk`` must add your modules source files to the
``SRC_USERMOD_C`` or ``SRC_USERMOD_LIB_C`` variables. The former will be
processed for ``MP_QSTR_`` and ``MP_REGISTER_MODULE`` definitions, the latter
will not (e.g. helpers and library code that isn't MicroPython-specific).
These paths should include your expaned copy of ``$(USERMOD_DIR)``, e.g.::
SRC_USERMOD_C += $(EXAMPLE_MOD_DIR)/modexample.c
SRC_USERMOD_LIB_C += $(EXAMPLE_MOD_DIR)/utils/algorithm.c
Similarly, use ``SRC_USERMOD_CXX`` and ``SRC_USERMOD_LIB_CXX`` for C++
source files.
If you have custom compiler options (like ``-I`` to add directories to search
for header files), these should be added to ``CFLAGS_USERMOD`` for C code
and to ``CXXFLAGS_USERMOD`` for C++ code.
* ``micropython.cmake`` contains the CMake configuration for this module.
In ``micropython.cmake``, you may use ``${CMAKE_CURRENT_LIST_DIR}`` as the path to
the current module.
Your ``micropython.cmake`` should define an ``INTERFACE`` library and associate
your source files, compile definitions and include directories with it.
The library should then be linked to the ``usermod`` target.
.. code-block:: cmake
add_library(usermod_cexample INTERFACE)
target_sources(usermod_cexample INTERFACE
${CMAKE_CURRENT_LIST_DIR}/examplemodule.c
)
target_include_directories(usermod_cexample INTERFACE
${CMAKE_CURRENT_LIST_DIR}
)
target_link_libraries(usermod INTERFACE usermod_cexample)
See below for full usage example.
Basic example
-------------
The ``cexample`` module provides examples for a function and a class. The
``cexample.add_ints(a, b)`` function adds two integer args together and returns
the result. The ``cexample.Timer()`` type creates timers that can be used to
measure the elapsed time since the object is instantiated.
The module can be found in the MicroPython source tree
`in the examples directory <https://github.com/micropython/micropython/tree/master/examples/usercmodule/cexample>`_
and has a source file and a Makefile fragment with content as described above::
micropython/
└──examples/
└──usercmodule/
└──cexample/
├── examplemodule.c
├── micropython.mk
└── micropython.cmake
Refer to the comments in these files for additional explanation.
Next to the ``cexample`` module there's also ``cppexample`` which
works in the same way but shows one way of mixing C and C++ code
in MicroPython.
Compiling the cmodule into MicroPython
--------------------------------------
To build such a module, compile MicroPython (see `getting started
<https://github.com/micropython/micropython/wiki/Getting-Started>`_),
applying 2 modifications:
1. Set the build-time flag ``USER_C_MODULES`` to point to the modules
you want to include. For ports that use Make this variable should be a
directory which is searched automatically for modules. For ports that
use CMake this variable should be a file which includes the modules to
build. See below for details.
2. Enable the modules by setting the corresponding C preprocessor macro to
1. This is only needed if the modules you are building are not
automatically enabled.
For building the example modules which come with MicroPython,
set ``USER_C_MODULES`` to the ``examples/usercmodule`` directory for Make,
or to ``examples/usercmodule/micropython.cmake`` for CMake.
For example, here's how the to build the unix port with the example modules:
.. code-block:: bash
cd micropython/ports/unix
make USER_C_MODULES=../../examples/usercmodule
You may need to run ``make clean`` once at the start when including new
user modules in the build. The build output will show the modules found::
...
Including User C Module from ../../examples/usercmodule/cexample
Including User C Module from ../../examples/usercmodule/cppexample
...
For a CMake-based port such as rp2, this will look a little different (note
that CMake is actually invoked by ``make``):
.. code-block:: bash
cd micropython/ports/rp2
make USER_C_MODULES=../../examples/usercmodule/micropython.cmake
Again, you may need to run ``make clean`` first for CMake to pick up the
user modules. The CMake build output lists the modules by name::
...
Including User C Module(s) from ../../examples/usercmodule/micropython.cmake
Found User C Module(s): usermod_cexample, usermod_cppexample
...
The contents of the top-level ``micropython.cmake`` can be used to control which
modules are enabled.
For your own projects it's more convenient to keep custom code out of the main
MicroPython source tree, so a typical project directory structure will look
like this::
my_project/
├── modules/
│ ├── example1/
│ │ ├── example1.c
│ │ ├── micropython.mk
│ │ └── micropython.cmake
│ ├── example2/
│ │ ├── example2.c
│ │ ├── micropython.mk
│ │ └── micropython.cmake
│ └── micropython.cmake
└── micropython/
├──ports/
... ├──stm32/
...
When building with Make set ``USER_C_MODULES`` to the ``my_project/modules``
directory. For example, building the stm32 port:
.. code-block:: bash
cd my_project/micropython/ports/stm32
make USER_C_MODULES=../../../modules
When building with CMake the top level ``micropython.cmake`` -- found directly
in the ``my_project/modules`` directory -- should ``include`` all of the modules
you want to have available:
.. code-block:: cmake
include(${CMAKE_CURRENT_LIST_DIR}/example1/micropython.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/example2/micropython.cmake)
Then build with:
.. code-block:: bash
cd my_project/micropython/ports/esp32
make USER_C_MODULES=../../../../modules/micropython.cmake
Note that the esp32 port needs the extra ``..`` for relative paths due to the
location of its main ``CMakeLists.txt`` file. You can also specify absolute
paths to ``USER_C_MODULES``.
All modules specified by the ``USER_C_MODULES`` variable (either found in this
directory when using Make, or added via ``include`` when using CMake) will be
compiled, but only those which are enabled will be available for importing.
User modules are usually enabled by default (this is decided by the developer
of the module), in which case there is nothing more to do than set ``USER_C_MODULES``
as described above.
If a module is not enabled by default then the corresponding C preprocessor macro
must be enabled. This macro name can be found by searching for the ``MP_REGISTER_MODULE``
line in the module's source code (it usually appears at the end of the main source file).
This macro should be surrounded by a ``#if X`` / ``#endif`` pair, and the configuration
option ``X`` must be set to 1 using ``CFLAGS_EXTRA`` to make the module available. If
there is no ``#if X`` / ``#endif`` pair then the module is enabled by default.
For example, the ``examples/usercmodule/cexample`` module is enabled by default so
has the following line in its source code:
.. code-block:: c
MP_REGISTER_MODULE(MP_QSTR_cexample, example_user_cmodule);
Alternatively, to make this module disabled by default but selectable through
a preprocessor configuration option, it would be:
.. code-block:: c
#if MODULE_CEXAMPLE_ENABLED
MP_REGISTER_MODULE(MP_QSTR_cexample, example_user_cmodule);
#endif
In this case the module is enabled by adding ``CFLAGS_EXTRA=-DMODULE_CEXAMPLE_ENABLED=1``
to the ``make`` command, or editing ``mpconfigport.h`` or ``mpconfigboard.h`` to add
.. code-block:: c
#define MODULE_CEXAMPLE_ENABLED (1)
Note that the exact method depends on the port as they have different
structures. If not done correctly it will compile but importing will
fail to find the module.
Module usage in MicroPython
---------------------------
Once built into your copy of MicroPython, the module
can now be accessed in Python just like any other builtin module, e.g.
.. code-block:: python
import cexample
print(cexample.add_ints(1, 3))
# should display 4
.. code-block:: python
from cexample import Timer
from time import sleep_ms
watch = Timer()
sleep_ms(1000)
print(watch.time())
# should display approximately 1000
.. _compiler:
The Compiler
============
The compilation process in MicroPython involves the following steps:
* The lexer converts the stream of text that makes up a MicroPython program into tokens.
* The parser then converts the tokens into an abstract syntax (parse tree).
* Then bytecode or native code is emitted based on the parse tree.
For purposes of this discussion we are going to add a simple language feature ``add1``
that can be use in Python as:
.. code-block:: bash
>>> add1 3
4
>>>
The ``add1`` statement takes an integer as argument and adds ``1`` to it.
Adding a grammar rule
----------------------
MicroPython's grammar is based on the `CPython grammar <https://docs.python.org/3.5/reference/grammar.html>`_
and is defined in `py/grammar.h <https://github.com/micropython/micropython/blob/master/py/grammar.h>`_.
This grammar is what is used to parse MicroPython source files.
There are two macros you need to know to define a grammar rule: ``DEF_RULE`` and ``DEF_RULE_NC``.
``DEF_RULE`` allows you to define a rule with an associated compile function,
while ``DEF_RULE_NC`` has no compile (NC) function for it.
A simple grammar definition with a compile function for our new ``add1`` statement
looks like the following:
.. code-block:: c
DEF_RULE(add1_stmt, c(add1_stmt), and(2), tok(KW_ADD1), rule(testlist))
The second argument ``c(add1_stmt)`` is the corresponding compile function that should be implemented
in ``py/compile.c`` to turn this rule into executable code.
The third required argument can be ``or`` or ``and``. This specifies the number of nodes associated
with a statement. For example, in this case, our ``add1`` statement is similar to ADD1 in assembly
language. It takes one numeric argument. Therefore, the ``add1_stmt`` has two nodes associated with it.
One node is for the statement itself, i.e the literal ``add1`` corresponding to ``KW_ADD1``,
and the other for its argument, a ``testlist`` rule which is the top-level expression rule.
.. note::
The ``add1`` rule here is just an example and not part of the standard
MicroPython grammar.
The fourth argument in this example is the token associated with the rule, ``KW_ADD1``. This token should be
defined in the lexer by editing ``py/lexer.h``.
Defining the same rule without a compile function is achieved by using the ``DEF_RULE_NC`` macro
and omitting the compile function argument:
.. code-block:: c
DEF_RULE_NC(add1_stmt, and(2), tok(KW_ADD1), rule(testlist))
The remaining arguments take on the same meaning. A rule without a compile function must
be handled explicitly by all rules that may have this rule as a node. Such NC-rules are usually
used to express sub-parts of a complicated grammar structure that cannot be expressed in a
single rule.
.. note::
The macros ``DEF_RULE`` and ``DEF_RULE_NC`` take other arguments. For an in-depth understanding of
supported parameters, see `py/grammar.h <https://github.com/micropython/micropython/blob/master/py/grammar.h>`_.
Adding a lexical token
----------------------
Every rule defined in the grammar should have a token associated with it that is defined in ``py/lexer.h``.
Add this token by editing the ``_mp_token_kind_t`` enum:
.. code-block:: c
:emphasize-lines: 12
typedef enum _mp_token_kind_t {
...
MP_TOKEN_KW_OR,
MP_TOKEN_KW_PASS,
MP_TOKEN_KW_RAISE,
MP_TOKEN_KW_RETURN,
MP_TOKEN_KW_TRY,
MP_TOKEN_KW_WHILE,
MP_TOKEN_KW_WITH,
MP_TOKEN_KW_YIELD,
MP_TOKEN_KW_ADD1,
...
} mp_token_kind_t;
Then also edit ``py/lexer.c`` to add the new keyword literal text:
.. code-block:: c
:emphasize-lines: 12
STATIC const char *const tok_kw[] = {
...
"or",
"pass",
"raise",
"return",
"try",
"while",
"with",
"yield",
"add1",
...
};
Notice the keyword is named depending on what you want it to be. For consistency, maintain the
naming standard accordingly.
.. note::
The order of these keywords in ``py/lexer.c`` must match the order of tokens in the enum
defined in ``py/lexer.h``.
Parsing
-------
In the parsing stage the parser takes the tokens produced by the lexer and converts them to an abstract syntax tree (AST) or
*parse tree*. The implementation for the parser is defined in `py/parse.c <https://github.com/micropython/micropython/blob/master/py/parse.c>`_.
The parser also maintains a table of constants for use in different aspects of parsing, similar to what a
`symbol table <https://steemit.com/programming/@drifter1/writing-a-simple-compiler-on-my-own-symbol-table-basic-structure>`_
does.
Several optimizations like `constant folding <http://compileroptimizations.com/category/constant_folding.htm>`_
on integers for most operations e.g. logical, binary, unary, etc, and optimizing enhancements on parenthesis
around expressions are performed during this phase, along with some optimizations on strings.
It's worth noting that *docstrings* are discarded and not accessible to the compiler.
Even optimizations like `string interning <https://en.wikipedia.org/wiki/String_interning>`_ are
not applied to *docstrings*.
Compiler passes
---------------
Like many compilers, MicroPython compiles all code to MicroPython bytecode or native code. The functionality
that achieves this is implemented in `py/compile.c <https://github.com/micropython/micropython/blob/master/py/compile.c>`_.
The most relevant method you should know about is this:
.. code-block:: c
mp_obj_t mp_compile(mp_parse_tree_t *parse_tree, qstr source_file, bool is_repl) {
// Create a context for this module, and set its globals dict.
mp_module_context_t *context = m_new_obj(mp_module_context_t);
context->module.globals = mp_globals_get();
// Compile the input parse_tree to a raw-code structure.
mp_compiled_module_t cm;
cm.context = context;
mp_compile_to_raw_code(parse_tree, source_file, is_repl, &cm);
// Create and return a function object that executes the outer module.
return mp_make_function_from_raw_code(cm.rc, cm.context, NULL);
}
The compiler compiles the code in four passes: scope, stack size, code size and emit.
Each pass runs the same C code over the same AST data structure, with different things
being computed each time based on the results of the previous pass.
First pass
~~~~~~~~~~
In the first pass, the compiler learns about the known identifiers (variables) and
their scope, being global, local, closed over, etc. In the same pass the emitter
(bytecode or native code) also computes the number of labels needed for the emitted
code.
.. code-block:: c
// Compile pass 1.
comp->emit = emit_bc;
comp->emit_method_table = &emit_bc_method_table;
uint max_num_labels = 0;
for (scope_t *s = comp->scope_head; s != NULL && comp->compile_error == MP_OBJ_NULL; s = s->next) {
if (s->emit_options == MP_EMIT_OPT_ASM) {
compile_scope_inline_asm(comp, s, MP_PASS_SCOPE);
} else {
compile_scope(comp, s, MP_PASS_SCOPE);
// Check if any implicitly declared variables should be closed over.
for (size_t i = 0; i < s->id_info_len; ++i) {
id_info_t *id = &s->id_info[i];
if (id->kind == ID_INFO_KIND_GLOBAL_IMPLICIT) {
scope_check_to_close_over(s, id);
}
}
}
...
}
Second and third passes
~~~~~~~~~~~~~~~~~~~~~~~
The second and third passes involve computing the Python stack size and code size
for the bytecode or native code. After the third pass the code size cannot change,
otherwise jump labels will be incorrect.
.. code-block:: c
for (scope_t *s = comp->scope_head; s != NULL && comp->compile_error == MP_OBJ_NULL; s = s->next) {
...
// Pass 2: Compute the Python stack size.
compile_scope(comp, s, MP_PASS_STACK_SIZE);
// Pass 3: Compute the code size.
if (comp->compile_error == MP_OBJ_NULL) {
compile_scope(comp, s, MP_PASS_CODE_SIZE);
}
...
}
Just before pass two there is a selection for the type of code to be emitted, which can
either be native or bytecode.
.. code-block:: c
// Choose the emitter type.
switch (s->emit_options) {
case MP_EMIT_OPT_NATIVE_PYTHON:
case MP_EMIT_OPT_VIPER:
if (emit_native == NULL) {
emit_native = NATIVE_EMITTER(new)(&comp->compile_error, &comp->next_label, max_num_labels);
}
comp->emit_method_table = NATIVE_EMITTER_TABLE;
comp->emit = emit_native;
break;
default:
comp->emit = emit_bc;
comp->emit_method_table = &emit_bc_method_table;
break;
}
The bytecode option is the default but something unique to note for the native
code option is that there is another option via ``VIPER``. See the
:ref:`Emitting native code <emitting_native_code>` section for more details on
viper annotations.
There is also support for *inline assembly code*, where assembly instructions are
written as Python function calls but are emitted directly as the corresponding
machine code. This assembler has only three passes (scope, code size, emit)
and uses a different implementation, not the ``compile_scope`` function.
See the `inline assembler tutorial <https://docs.micropython.org/en/latest/pyboard/tutorial/assembler.html#pyboard-tutorial-assembler>`_
for more details.
Fourth pass
~~~~~~~~~~~
The fourth pass emits the final code that can be executed, either bytecode in
the virtual machine, or native code directly by the CPU.
.. code-block:: c
for (scope_t *s = comp->scope_head; s != NULL && comp->compile_error == MP_OBJ_NULL; s = s->next) {
...
// Pass 4: Emit the compiled bytecode or native code.
if (comp->compile_error == MP_OBJ_NULL) {
compile_scope(comp, s, MP_PASS_EMIT);
}
}
Emitting bytecode
-----------------
Statements in Python code usually correspond to emitted bytecode, for example ``a + b``
generates "push a" then "push b" then "binary op add". Some statements do not emit
anything but instead affect other things like the scope of variables, for example
``global a``.
The implementation of a function that emits bytecode looks similar to this:
.. code-block:: c
void mp_emit_bc_unary_op(emit_t *emit, mp_unary_op_t op) {
emit_write_bytecode_byte(emit, 0, MP_BC_UNARY_OP_MULTI + op);
}
We use the unary operator expressions for an example here but the implementation
details are similar for other statements/expressions. The method ``emit_write_bytecode_byte()``
is a wrapper around the main function ``emit_get_cur_to_write_bytecode()`` that all
functions must call to emit bytecode.
.. _emitting_native_code:
Emitting native code
---------------------
Similar to how bytecode is generated, there should be a corresponding function in ``py/emitnative.c`` for each
code statement:
.. code-block:: c
STATIC void emit_native_unary_op(emit_t *emit, mp_unary_op_t op) {
vtype_kind_t vtype;
emit_pre_pop_reg(emit, &vtype, REG_ARG_2);
if (vtype == VTYPE_PYOBJ) {
emit_call_with_imm_arg(emit, MP_F_UNARY_OP, op, REG_ARG_1);
emit_post_push_reg(emit, VTYPE_PYOBJ, REG_RET);
} else {
adjust_stack(emit, 1);
EMIT_NATIVE_VIPER_TYPE_ERROR(emit,
MP_ERROR_TEXT("unary op %q not implemented"), mp_unary_op_method_name[op]);
}
}
The difference here is that we have to handle *viper typing*. Viper annotations allow
us to handle more than one type of variable. By default all variables are Python objects,
but with viper a variable can also be declared as a machine-typed variable like a native
integer or pointer. Viper can be thought of as a superset of Python, where normal Python
objects are handled as usual, while native machine variables are handled in an optimised
way by using direct machine instructions for the operations. Viper typing may break
Python equivalence because, for example, integers become native integers and can overflow
(unlike Python integers which extend automatically to arbitrary precision).
.. _extendingmicropython:
Extending MicroPython in C
==========================
This chapter describes options for implementing additional functionality in C, but from code
written outside of the main MicroPython repository. The first approach is useful for building
your own custom firmware with some project-specific additional modules or functions that can
be accessed from Python. The second approach is for building modules that can be loaded at runtime.
Please see the :ref:`library section <internals_library>` for more information on building core modules that
live in the main MicroPython repository.
.. toctree::
:maxdepth: 3
cmodules.rst
natmod.rst
.. _gettingstarted:
Getting Started
===============
This guide covers a step-by-step process on setting up version control, obtaining and building
a copy of the source code for a port, building the documentation, running tests, and a description of the
directory structure of the MicroPython code base.
Source control with git
-----------------------
MicroPython is hosted on `GitHub <https://github.com/micropython/micropython>`_ and uses
`Git <https://git-scm.com>`_ for source control. The workflow is such that
code is pulled and pushed to and from the main repository. Install the respective version
of Git for your operating system to follow through the rest of the steps.
.. note::
For a reference on the installation instructions, please refer to
the `Git installation instructions <https://git-scm.com/book/en/v2/Getting-Started-Installing-Git>`_.
Learn about the basic git commands in this `Git Handbook <https://guides.github.com/introduction/git-handbook/>`_
or any other sources on the internet.
.. note::
A .git-blame-ignore-revs file is included which avoids the output of git blame getting cluttered
by commits which are only for formatting code but have no functional changes. See `git blame documentation
<https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revltrevgt>`_ on how to use this.
Get the code
------------
It is recommended that you maintain a fork of the MicroPython repository for your development purposes.
The process of obtaining the source code includes the following:
#. Fork the repository https://github.com/micropython/micropython
#. You will now have a fork at <https://github.com/<your-user-name>/micropython>.
#. Clone the forked repository using the following command:
.. code-block:: bash
$ git clone https://github.com/<your-user-name>/micropython
Then, `configure the remote repositories <https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes>`_ to be able to
collaborate on the MicroPython project.
Configure remote upstream:
.. code-block:: bash
$ cd micropython
$ git remote add upstream https://github.com/micropython/micropython
It is common to configure ``upstream`` and ``origin`` on a forked repository
to assist with sharing code changes. You can maintain your own mapping but
it is recommended that ``origin`` maps to your fork and ``upstream`` to the main
MicroPython repository.
After the above configuration, your setup should be similar to this:
.. code-block:: bash
$ git remote -v
origin https://github.com/<your-user-name>/micropython (fetch)
origin https://github.com/<your-user-name>/micropython (push)
upstream https://github.com/micropython/micropython (fetch)
upstream https://github.com/micropython/micropython (push)
You should now have a copy of the source code. By default, you are pointing
to the master branch. To prepare for further development, it is recommended
to work on a development branch.
.. code-block:: bash
$ git checkout -b dev-branch
You can give it any name. You will have to compile MicroPython whenever you change
to a different branch.
Compile and build the code
--------------------------
When compiling MicroPython, you compile a specific :term:`port`, usually
targeting a specific :ref:`board <glossary>`. Start by installing the required dependencies.
Then build the MicroPython cross-compiler before you can successfully compile and build.
This applies specifically when using Linux to compile.
The Windows instructions are provided in a later section.
.. _required_dependencies:
Required dependencies
~~~~~~~~~~~~~~~~~~~~~
Install the required dependencies for Linux:
.. code-block:: bash
$ sudo apt-get install build-essential libffi-dev git pkg-config
For the stm32 port, the ARM cross-compiler is required:
.. code-block:: bash
$ sudo apt-get install arm-none-eabi-gcc arm-none-eabi-binutils arm-none-eabi-newlib
See the `ARM GCC
toolchain <https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads>`_
for the latest details.
Python is also required. Python 2 is supported for now, but we recommend using Python 3.
Check that you have Python available on your system:
.. code-block:: bash
$ python3
Python 3.5.0 (default, Jul 17 2020, 14:04:10)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
All supported ports have different dependency requirements, see their respective
`readme files <https://github.com/micropython/micropython/tree/master/ports>`_.
Building the MicroPython cross-compiler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Almost all ports require building ``mpy-cross`` first to perform pre-compilation
of Python code that will be included in the port firmware:
.. code-block:: bash
$ cd mpy-cross
$ make
.. note::
Note that, ``mpy-cross`` must be built for the host architecture
and not the target architecture.
If it built successfully, you should see a message similar to this:
.. code-block:: bash
LINK mpy-cross
text data bss dec hex filename
279328 776 880 280984 44998 mpy-cross
.. note::
Use ``make -C mpy-cross`` to build the cross-compiler in one statement
without moving to the ``mpy-cross`` directory otherwise, you will need
to do ``cd ..`` for the next steps.
Building the Unix port of MicroPython
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Unix port is a version of MicroPython that runs on Linux, macOS, and other Unix-like operating systems.
It's extremely useful for developing MicroPython as it avoids having to deploy your code to a device to test it.
In many ways, it works a lot like CPython's python binary.
To build for the Unix port, make sure all Linux related dependencies are installed as detailed in the
required dependencies section. See the :ref:`required_dependencies`
to make sure that all dependencies are installed for this port. Also, make sure you have a working
environment for ``gcc`` and ``GNU make``. Ubuntu 20.04 has been used for the example
below but other unixes ought to work with little modification:
.. code-block:: bash
$ gcc --version
gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.then build:
.. code-block:: bash
$ cd ports/unix
$ make submodules
$ make
If MicroPython built correctly, you should see the following:
.. code-block:: bash
LINK micropython
text data bss dec hex filename
412033 5680 2496 420209 66971 micropython
Now run it:
.. code-block:: bash
$ ./micropython
MicroPython v1.13-38-gc67012d-dirty on 2020-09-13; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> print("hello world")
hello world
>>>
Building the Windows port
~~~~~~~~~~~~~~~~~~~~~~~~~
The Windows port includes a Visual Studio project file micropython.vcxproj that you can use to build micropython.exe.
It can be opened in Visual Studio or built from the command line using msbuild. Alternatively, it can be built using mingw,
either in Windows with Cygwin, or on Linux.
See `windows port documentation <https://github.com/micropython/micropython/tree/master/ports/windows>`_ for more information.
Building the STM32 port
~~~~~~~~~~~~~~~~~~~~~~~
Like the Unix port, you need to install some required dependencies
as detailed in the :ref:`required_dependencies` section, then build:
.. code-block:: bash
$ cd ports/stm32
$ make submodules
$ make
Please refer to the `stm32 documentation <https://github.com/micropython/micropython/tree/master/ports/stm32>`_
for more details on flashing the firmware.
.. note::
See the :ref:`required_dependencies` to make sure that all dependencies are installed for this port.
The cross-compiler is needed. ``arm-none-eabi-gcc`` should also be in the $PATH or specified manually
via CROSS_COMPILE, either by setting the environment variable or in the ``make`` command line arguments.
You can also specify which board to use:
.. code-block:: bash
$ cd ports/stm32
$ make submodules
$ make BOARD=<board>
See `ports/stm32/boards <https://github.com/micropython/micropython/tree/master/ports/stm32/boards>`_
for the available boards. e.g. "PYBV11" or "NUCLEO_WB55".
Building the documentation
--------------------------
MicroPython documentation is created using ``Sphinx``. If you have already
installed Python, then install ``Sphinx`` using ``pip``. It is recommended
that you use a virtual environment:
.. code-block:: bash
$ python3 -m venv env
$ source env/bin/activate
$ pip install sphinx
Navigate to the ``docs`` directory:
.. code-block:: bash
$ cd docs
Build the docs:
.. code-block:: bash
$ make html
Open ``docs/build/html/index.html`` in your browser to view the docs locally. Refer to the
documentation on `importing your documentation
<https://docs.readthedocs.io/en/stable/intro/import-guide.html>`_ to use Read the Docs.
Running the tests
-----------------
To run all tests in the test suite on the Unix port use:
.. code-block:: bash
$ cd ports/unix
$ make test
To run a selection of tests on a board/device connected over USB use:
.. code-block:: bash
$ cd tests
$ ./run-tests.py --target minimal --device /dev/ttyACM0
See also :ref:`writingtests`.
Folder structure
----------------
There are a couple of directories to take note of in terms of where certain implementation details
are. The following is a break down of the top-level folders in the source code.
py
Contains the compiler, runtime, and core library implementation.
mpy-cross
Has the MicroPython cross-compiler which pre-compiles the Python scripts to bytecode.
ports
Code for all the versions of MicroPython for the supported ports.
lib
Low-level C libraries used by any port which are mostly 3rd-party libraries.
drivers
Has drivers for specific hardware and intended to work across multiple ports.
extmod
Contains a C implementation of more non-core modules.
docs
Has the standard documentation found at https://docs.micropython.org/.
tests
An implementation of the test suite.
tools
Contains scripts used by the build and CI process, as well as user tools such
as ``pyboard.py`` and ``mpremote``.
examples
Example code for building MicroPython as a library as well as native modules.
micropython/docs/develop/img/bitmap.png

6.24 KiB