Граф коммитов

31 Коммитов

Автор SHA1 Сообщение Дата
Michał Moskal d411cee039
add support for NRF52 (#1067)
* Add Flash::totalSize() method

* Fix doc comment

* Move JACDAC timer to core

* Add support for NRF52

* Don't panic on missing button config (happens on maker)
2020-01-31 17:49:55 -08:00
Michał Moskal b458ee7066
Remove non-GC outdated code (#1042)
* remove vtableshift

* Remove #ifdef PXT_GC

* Remove incr/decr calls
2019-12-18 13:52:35 -08:00
Michał Moskal 32f0a7900d
Dynamic allocation of timers (#1005)
* Start on dynamic TCC definitions

* Add comments on pins used

* Lazy timer init

* Add code for actual dynamic timer alloc on SAMD

* Dynamic timers on STM

* Log timer alloc
2019-12-06 19:31:22 -08:00
Michał Moskal ea0d51bdec reorg core---linux to use in EV3 (#982)
* Move things from target.cpp to dmesg.cpp

* Remove unsafePollForChanges

* Harmonize 32 bit and 64 bit serial numbers across platforms

* Move reading serial number back to target

* Remove unused code

* moving block to allow hiding

* bump dependency

* rename

* more renaming

* integrating user thread lock on reset

* return trylock result
2019-10-08 16:17:00 -07:00
Michał Moskal 6f6882c0e0
Don't trigger 'any' events twice (#976)
* Pass flags to listener

* Don't trigger 'any' events twice
2019-10-04 08:10:55 +01:00
Michał Moskal ce1bf6d8eb
Add control.micros() and control.benchmark() (#932) 2019-08-20 17:35:25 -07:00
James Devine 95551dcdef Jacdac updates (#893)
* update jacdac

* fix jacdac debugger

* patch update script

* add tabs to console

* setInterval created in ctor

* add api to get 64-bit serial number

* simulate as Buffer not number

* use refbuffer instead

* use buffer methods on RefBuffer

* add getLongSerialNumber to linux builds.
2019-07-29 17:22:04 -07:00
Michał Moskal ef43b2c8ee
runtime support for exceptions (#900)
* Runtime support for exceptions

* Add try support in VM

* Expose some functions to  vm

* More logging
2019-07-29 14:04:07 -07:00
Michał Moskal d728cfe5c2 support for pxt64 VM (#828)
* starting 64 bit cleanup

* 64 bit cleanup of gc

* More work on 64 bit intgers

* Fix compilation; binary compat checkpoint

* Add nan-boxing

* More 64bit fixes

* Compilation fixes

* start on the vm

* More opcodes

* more validation setup

* add call/ret

* Switch to 16 bit opcode encoding

* Re-working sections

* Working on doubles

* Work on callind

* Add fake missing methods

* Add some image loading code

* Basic opcode validation

* Move VM stuff to new vm.h; clean comments

* Add opcode resolution

* rtcall validation

* Add validating startup code for vm

* Fixes for opcode map

* Allow for PXT-genarted shim table

* Bugfixes; logging

* Fix decoding of ret; verifcation fixes

* Add todo

* Starting to remove linux stuff from vm

* Clone files from core---linux

* Bugfix

* Start on the interpreter dispatch loop

* work on the scheduler

* Add todo

* Action handling

* Add vt sect

* remove todo

* Work on iface and method calls

* Switch to all iface calls for vm

* VTable simplification

* ldfld/stfld

* Add newobj opcode

* Show missing symbols

* Expose screen apis to vm

* Validate vtables

* 64bit fix for string alloc

* Move 64 bit gc to 0x20_0000_0000

* Re-allocate strings from image in gc heap

* Add more logging to gc

* 64 bit fixes

* Closure fixes

* VTable fixup

* Add callget/set

* Working on iface name table

* Fix for lookupMapKey and emptyString

* Don't use the bytecode[] array in VM

* add checkinst opcode; cleanup

* isTagged vs isPointer

* Add helper functions for type checks

* Add dynamic map lookups

* Add mapget/set

* Fix VT check

* Start running the program; various fixes

* Various fixes

* Fixes

* Various vm fixes

* high volume logging

* Allow pre-allocation of stuff on non-gc heap

* Add dmesg_flush()

* Bugfixes

* 64k gc block size

* Don't sort string pointers for now

* Threading

* Fix pixel order

* Event support

* Windows fixes

* CLI fix

* Various windows build fixes; add control.setDebugFlags

* Add missing symbol

* Copy pthread dll

* Lower optimization level

* Link Win DLL statically to mingw

* New music APIs

* Add stop playing; work on the TS side

* Codal connection

* Handle activation

* Drop codal from linux build

* Fix build

* queuePlayInstructions works in sim

* Codal fixes

* Hardware fixes; works

* Thread safety for mixer; add ringtone (clicking)

* Default per-melody volume to 100%

* Only use the play loop for sounds over 2s

* Remove codal refs from VM

* Fix includes for codal-less build

* Build the SDL shell

* Fix build rules

* Test program for log queue

* Move log queue tests

* Pipe logs to SDL

* Allow for restart of VM thread

* Add mixer---ext

* Fix memory errors in melody

* Fix memory errors in melody

* Fast adds/subs for VM

* Don't crash if screen accessed too early

* Add support for push_mask

* Verify push bits

* Fix windows SDL build

* Strip VM binaries for smaller size

* Cleanup

* Bugfix

* Change VAR_BLOCK_WORDS to what it was

* Update TODO comments
2019-05-24 05:10:51 -07:00
Tom Ball 5a691f2f15
Fix ANY processing (#829)
* remove extra processing for ANY  wildcard

* process ANY consistently with CODAL/SIM

* fix syntax errors

* fix errors

* fix infinite looping

* fix for anyButton hack
2019-05-17 08:30:54 -07:00
Michał Moskal 2b75fb8948 Support for micro:bit (#661)
* Fix #ifdef

* Add RefMImage

* Move globals initialization after initRuntime()

* Revert "Move globals initialization after initRuntime()"

This reverts commit ac1b00a336.

* Account for uninitialized scheduler

* Intialize memory allocator
2019-02-06 09:16:31 -08:00
Michał Moskal 83882a3fcc
support for USB on SAMD51 (#629)
Also:
* fix CFG_ keys for BTNMX; change encoding there of buttons
* shut down neopixels on pybadge on startup (using SPI)
* try to limit heap fragmentation more (at some runtime cost)
* rework getting bootloader config data (for newer bootloaders)
* use the new codal timers
* `config.ts` now overrides bootloader settings, not the other way around
2019-01-10 21:44:43 +00:00
Michał Moskal 3e0a8aebbe
use GC heap for almost all allocations (#540)
This replaces codal's implementations of malloc/free with our own, which will generally use our GC heap for allocations, unless we're inside of an interrupt or in the middle of a GC cycle.

There are also changes to limit fragmentation of the GC heap (we generally try to fit allocations within the first half of free memory, and force GC when that is not possible).

Requires codal-core b059fa81208655a8094283a3110810087a5a8fa4
2018-12-07 15:06:12 -08:00
Michał Moskal ac7fee91c4 Support for pxt heapdump (#512)
* Support for pxt dumpheap

* Add control.heapDump()

* Add missing F103 pins
2018-11-30 14:21:05 -08:00
Peli de Halleux b162ea5555
Prevent recursive panic (#493)
* prevent recursive panicing

* disable irq during gcsweep

* fix build

* do not disable interrup during gcProcessStacks

* use boolean
2018-11-21 08:38:42 -08:00
Peli de Halleux 1662aad928
Clean up fibers (#492)
* mem leak fix in gc

* gc stress mode
2018-11-20 20:31:16 -08:00
Michał Moskal e999ac3b36 Use codal's thread list - fixes crash (#482) 2018-11-19 15:16:09 -08:00
Michał Moskal 82106198a3
Support for GC, and some new APIs (#423)
This is in support of PXT GC

Also:
* add `control.dmesgValue()`
* add `control.gc()`
* add `control.profilingEnabled()`
* add `control.dumpPerfCounters()`
* add pseudo-API `control.enablePerfCounter()` (enables profiling for function if present; handled by compiler)
* add `JSON.parse` and `JSON.stringify` (in TS)
* adjust to codal `master`
* synchronous handlers for collisions (this will need to be changed to drop-when-running) CC @riknoll 
* frowny face on panic on hardware
2018-11-12 15:34:52 -08:00
Michał Moskal 1750f98349
Support for ATSAMD51 (#416)
* Start on SAMD51 support

* Adopt to pktserial branch codal-core

* Build fixes

* Intialize DMAC

* No I2C on D51 yet
2018-09-25 18:26:45 -07:00
Peli de Halleux 0f3a9faaff
Support for pins.onPulsed events (#308)
* moving sim from pxt

* revamp on pulse

* update version

* modified pulse

* refactor onPulsed

* fixed switch an dtoggle state

* dispatch timestamp

* adding on event

* fixing docs

* update blocks ntations

* better support for setting a pin value

* updated shims

* revert codal change

* bump pxt
2018-05-17 08:58:58 -07:00
Michał Moskal 06a624a1fa Support for .comm symbols in assembly (#280)
* Support for .comm symbols in assembly

* Fixes in .comm allocation
2018-04-05 19:08:56 -07:00
Michał Moskal 30e86ba9a2
Make Pin and Timer types configurable (#248) 2018-03-19 13:25:05 +00:00
Peli de Halleux 4e1e933206
add 500ms sleep on start to allow HID interfaces to "settle" (#215) 2018-01-25 16:25:27 -08:00
Peli de Halleux 69a5cd9e93
Runinparallel (#209)
* adding control.runInParallel

* more docs

* typo

* updated docs

* typo

* minor version change
2018-01-23 13:14:46 -08:00
Michał Moskal c0d078f79b Support for codal targets other than SAMD21 (#195)
* Towards retargetable core

* Split out PwmOnlyPin

* Move general pin defs to platform.h

* Move temp. and light-sensor calibration to platform.h

* Account for namespace differences between codal-mbed and codal-mbedos
2017-12-12 09:28:16 -08:00
Tom Ball ab1df313ff
add plumbing for event flags (#167) 2017-11-07 18:15:30 -08:00
Michał Moskal 2e3ab19537 Support for multiple boards in a single target (#140)
* Start on pinouts in TS

* Define pins in TS

* Add BOARD_LAYOUT and friends

* Remove board layout - probably won't be needed

* Converting to const format

* Zero config moved to metro-express/device.d.ts

* Hack in touch; CPX config moved

* Move touch pin config to board package

* Add dal.d.ts config

* Use pin names

* Buttons now allocated dynamically

* Add CFG_PIN_A**

* Align buttons with simulator

* Button simplification

* New syntax for board configs

* Trinket moved out

* Allow getting buttons attached to pin instances

* New codal fixes

* SWD debugging fixes

* Avoid button crash

* Bump to 0.11.0

* 0.11.1
2017-10-23 13:48:41 -07:00
Michał Moskal 34f31243ed Switching to newest codal (CPX v1.2.2) (#139) 2017-10-21 08:30:01 -07:00
Michal Moskal 8a38a861c9 Move hf2 debug completely from base to core 2017-10-13 21:29:50 +02:00
Tom Ball a01fecf51f Untagged (#115)
Replace `uint32_t` with `unsigned` for 8 bit compat
2017-09-26 10:32:45 -07:00
Michał Moskal a615dc0086 Switch to v1.x of codal (with new build system) (#95)
* Great renaming

* More renamings and fixes

* mbed::Pin...

* Fix i2c

* Additional checks on ref-counts

* Disable dbg output

* Fix include file name

* Start split of core into base and core

* Move more stuff over

* Change ref-tags

* Define own buffer and string

* First draft builds

* Add remiaining files

* Move stuff to core/control.cpp

* Rebuild shims

* Rebuild .d.ts again

* Use new Buffer apis

* Fix dep

* List all target functions in one place

* Move AnimationQueue from base to core

* Do not rely on the C++ map<> class in event handlers

* Do not rely on C++ vector

* Fix refmap destroy code

* Simplification

* Limit std C++ includes

* Implement swap()

* Move AnimationQ back to base

* Refactor number read/write methods for buffers so they can be used on other pointers

* Add Buffer.toHex()

* Change sim file paths to reflect the split of files into core and base

* Update the major version

* Depend on the latest pxt-core version

* 0.9.1
2017-08-04 14:58:55 -07:00