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

50 Коммитов

Автор SHA1 Сообщение Дата
Michał Moskal f4c3b41cf8
Improve exception handling on esp32 (#1289)
* Use soft_panic() for user errors (when mem-corruption unlikely)

* Improve soft_panic() on esp32

* make stack trace easier to parse
2021-10-20 00:13:13 +02:00
Peli de Halleux 7db00831b5
Move JACDAC out of common-packages (#1118)
* moving jacdac out of common packages

* Make the jddisplay self-contained

* move to 8.0

Co-authored-by: Michal Moskal <michal@moskal.me>
2020-06-10 09:41:18 -07:00
Michał Moskal 294033ca23
new JACDAC implementation (#1090)
Most of the implementation is now in pxt-common-packages. The packet format has changed is now more structured. There is also a few additional protocol-level features (broadcast commands, optional ACKs, and packing of multiple packets into a single frame).

Also adds the following APIs:
* `buffer.hash()` using FNV-1 hash
* `buffer.equals()`
* `buffer.chunked()` which splits buffer into pieces of given size
* `buffer.isReadOnly()`
* `Buffer. chunkedFromUTF8()` which takes strings and returns a list of buffers up to max given size (it respects character boundaries)

Also adds support for jacdac-over-SPI screens.
2020-04-09 12:27:31 -07:00
Galen Nickel d16351eca8
Change out more pixel examples (#1085)
* Change out more pixel examples

* random type fix
2020-03-25 23:31:39 -07:00
Peli de Halleux edbefc5d4f
support for continuous servo in sim (#1073)
* add continuous servo info and track in simulator

* track continuous and update rendering

* always render when continuous

* non-breaking change

* fix sig

* refresh shims

* build issues

* fixing typo

* fixing typo

* typo

* fix sun
2020-02-13 17:16:39 -08:00
Michał Moskal bfe63058db
Move Arcade button handling from buttons to game---hw (#1063) 2020-01-23 16:22:14 -08:00
Michał Moskal 6decc168ff Add Button::pressureLevel() (#934)
* Add Button::pressureLevel()

* Sim support

* Add deviceDalVersion to linux; make it return "sim" in sim

* Add pressureLevel to controller

* Add controller.player1

* Add some comments

* Rename variables

* Remove pressure-level block
2019-11-27 04:10:29 +01:00
Galen Nickel 6ec8fdfc27 Fix some typos found by Crowdin translators (#1007)
* Fix some typos found by Crowdin translators

* us mu symbol
2019-11-06 05:31:20 -08:00
Peli de Halleux 5ab52df9d4
pulling in jacdac-ts (#779)
* pulling in jacdac-ts

* updated instructions

* fix path

* adding dummy c++

* adding function get/set for bytes

* account for file rename

* almost compiling..

* updated signature

* override jacdac options correctly

* Now building... on samd21

* updated getpacket layer

* Update c++, add jacdactimer and add console service to pxt.json

* add start call

* add nullptr check

* jacdac-ts working with makecode

* adding bus stop, isRunning, state

* Jacdac ts migrated (#783)

* mostly moved everntying into jacdac

* more build issues

* inheriting

* sim support

* remove invalid enum

* removing battery

* more refactoring

* a bunch of updates

* more fixes

* bump jacdac-ts

* raise event when jacdac incoming

* bump minor

* 6.6.1

* adding link script

* missing pixel

* c++ fix

* fix lcd

* sketch of console service

* adding mode

* fixing more console things

* cleanuip

* fixing debugg

* removed getState

* fix signature

* protect log

* start jacdac on start

* typo

* adding stop

* fix .ctor

* more logging

* missing addAvertisementData

* fixed auto-stop, missing define name

* support for debbuger usb

* adding callback for JD

* added comment

* console.warning -> console.warn

* use jacdac console service

* enable logging in debugger

* fix arcade build

* use new send method

* set physical layer on the usb driver (there's no common singleton anymore...)

* tweaks

* Add optional pin configurations to pins (like active lo)

* update ctor to account for active lo pins

* typos

* inline constant

* fixing arcade debugger

* fixing controller build

* adding keyvalue store impl

* save/load name

* handle name

* add missing shims

* fixing sim

* add a bit of logging

* adding light color jacdac service

* fix keyboard client

* updated links

* moving out debug views

* updated jacdac dependency number

* reduce default brightness

* adding color detection

* KeyValueStorage: store length alongside string

* Add identification functionality

* adding light sensor

* refactor

* adding leveldetector

* added level detector

* Add servo advertisement data to servo jacdac

* Fix tsl2591

* adding proxmity driver

* adding events

* patches to prox sensor. Trying to debounce it because we're getting some junk

* add one register for high precision mode (future work)

* adding light spectrum client

* fix event id

* cleanup identification service

* slow down streaming

* clean color sensor

* do HSV in a neopixel compatible way

* clean

* cleanup

* fix rainbow

* updated default value

* adding multibuttons

* optimize setbrightness

* fix

* support more events

* request update before accessing acceleraomter data

* support for custom gestures

* handle missing context

* guard webusb jacdac

* enable custom gestures

* update custom event id

* Lightransitions (#810)

* adding transition player

* update transitions

* removing logging

* onidle context fix

* fix transitions

* fix transitions

* use start stop brightness

* add yoyo

* added repeat

* support all button events on tattoo

* adding multi-servo support

* fix events

* specify required devince name

* requiredDevicename

* fixing servo

* export SparkleAnimation construcotr

* support for sensor calibration

* expose more animations

* add api to stop brightness transition

* send byte aligned buffers in jacdac

* fixing build

* remove extra logging

* copyright notice

* Fix compile for arcade

* adding lienear gradient api

* NVM Controller does not work on samd51

* updated pxt version

* update debugger.ts to new consoleService apis

* Begin work on debugger interface, start with diagnostics...

* adding sim support

* fix i2creadreg

* create a blank JDDiagnostics if no bus exists

* use internalOnEvent for jacdac-ts

* fix build

* add jacdac timer to samd51

* Fix endless spin due to competition over Sercoms

SPI neopixel would compete with i2c over the same sercoms. The correct patch here would be to use SERCOM4 for neopixel, but for now just use the .h version of the neopixel driver.

The minimum size required to use spi neopixel has increased to 24 bytes, which is 8 rgb values.

* bump arcade

* restore ifdefs in light.cpp (didn't realise it would affect all platforms)

* fixup bad change to light.cpp

* start bus before the control layer

* comment out controller service

* WIP: debugger.ts
2019-05-24 05:39:57 -07:00
Michał Moskal 43e6776a41 Support analog joystick and active high buttons (#805)
also fixes for button multiplexer
2019-04-29 10:39:41 -04: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
Peli de Halleux 2ad28c9b96
support for onboard buttons (#607) 2019-01-02 12:22:08 -08:00
Peli de Halleux 4070c35ddd
don't mark buttons api since they are shared with touch (#606) 2019-01-02 11:38:08 -08:00
Peli de Halleux cd93b6d8db start controller client after attaching butotn 2018-12-29 22:01:11 -08:00
Peli de Halleux 3ca7040cfa
Jacdac controller client (#596)
* adding client suffix

* refactored iterval

* renaming enums

* adding help to bind button to controller

* fix number of pins

* updated namespaces

* pop game when connecting

* formatting

* collect player index

* auto-start service

* cleaner add remove of drivers

* handling server timeout

* better restart logic

* udpated text

* longer period
2018-12-26 13:30:05 -08:00
Peli de Halleux 8fefa9e926 moving particles to separate project 2018-12-12 16:24:37 -08:00
Peli de Halleux 5e463fa6f6
Jacdac service clients (#539)
* host -> service, virtual -> client

* more renamings

* more renames

* fixing files

* more shuffle

* cleaner starting modes

* fixing file

* add fixed instance

* more blocks notations

* more blocks

* fix stack overflow

* updated namespaces

* fixing renaming

* refactoring cleaning
2018-12-06 18:57:15 -08:00
Peli de Halleux 1a18c4717b
More JacDac drivers (#520)
* adding light sensor

* adding more drivers

* more jacdac drivers

* updated categories

* updated namespace
2018-12-03 22:41:47 -08:00
Michał Moskal af48a41c60
Support on buttons via external chip (#514)
* Start on button multiplexer

* Add more config stuff

* Button fixes
2018-11-30 17:47:45 -08:00
Peli de Halleux d03ca8f1ac
Jacdacbuttons (#509)
* adding button drivers

* fixing blocks

* adding touch drivers

* handle older JD implementations

* more ifdefing

* handling missing jacdac
2018-11-30 01:00:04 -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
Peli de Halleux dc00f6852c
Name clashing fixing for microbit. (#421)
* renaming DigitalPin to DigitalInOutPin

* updated shims

* updated shims

* more shim updates

* added typealias

* AnalogPin -> AnalogInOutPin
2018-10-04 16:21:32 -07:00
Peli de Halleux ce6a1c7b60
fix button in brainpad (#357) 2018-06-13 13:23:49 -07:00
Michał Moskal e3e405f62a
Add core---stm32f401re (#344)
Adds support for STM32F401 (from maker), also:

add support for ST7735 screens (moved from maker)
support getting settings from bootloader area
add config-indirect versions of getPin and getButton functions
minor fixes to dialogs to align color and mono versions
2018-06-12 08:14:21 -07:00
Peli de Halleux aa9ef09619 Colors. -> hex (#287)
* Colors. -> hex
2018-04-16 14:15:00 -07:00
Peli de Halleux d564be619c
Support for accelerometer simulation (#254)
* refactoring acceleraomter simulator support

* updated type

* fixed decay
2018-03-22 09:55:30 -07:00
Peli de Halleux 8790429be4
Event Context (#251)
* towards an event context

* fixing shim generation

* reverting button update

* updated flags handling

* fixing sim

* always use event context in game mode

* incorrect context

* merging frame support in event context

* adding game context

* wrapping screen into the event context

* handling of keys

* using internalevent for keys

* fixed stack lookup

* updated stats

* guard event context

* rollback key list

* guard for missing context
2018-03-22 09:24:15 -07:00
Peli de Halleux 8d89e7d4a7
tweak keys to support C++ (#241) 2018-03-15 20:26:12 -07:00
Galen Nickel b51a781b7a Section tagging for target overrides in docs - 02 (#229) 2018-02-26 10:25:48 -08:00
Richard Knoll 11fa8efe9f Make forever and pause be top level (#227)
* Moving forever and pause to be top level

* Fixing docs for forever and pause
2018-02-14 15:38:17 -08:00
Peli de Halleux 121248732f
Add proper unit test framework for pxt packages (#199)
* adding unit test framework

* refreshing shims

* fixing any issue

* hiding event block

* bump version
2018-01-04 09:12:46 -08:00
Sam El-Husseini bb572ffac6
Remove picker functions from intellisense, extend CommonButtonState to support any number of buttons (#193) 2017-12-11 08:45:22 -08:00
Galen Nickel b2bf70b9d3 Generalize light examples, 02 (#185) 2017-11-27 15:25:29 -08:00
Abhijith Chatra af57dbcae4 increasing the gap slightly (#177) 2017-11-10 11:28:51 -08:00
Galen Nickel 255fa8b4f9 Add some docs for 'touch' button functions (#161) 2017-11-08 00:09:49 +01:00
Sam El-Husseini c4e9491414
Fix sim shims (#164)
* Fix sim shims

* Add placeholder for toHex

* More fixes
2017-11-07 13:28:45 -08:00
Richard Knoll f1929fd7e6 Moving button events enum to buttons package (#153) 2017-10-27 07:57:53 +02:00
Sam El-Husseini ae3987a1ca Update button annotations to support breadboarding (#149) 2017-10-26 08:47:52 +02:00
Michal Moskal ab82aec00e Update shim files 2017-10-24 09:32:56 +01:00
Peli de Halleux 6c1cd1e2f0 fixing button test 2017-10-23 14:03:06 -07: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
Peli de Halleux ecd1afb93d updating shims 2017-10-13 16:40:50 -07:00
Sam El-Husseini 6debceed9e Refactor blocks to remove subcategories, and order some in groups. (#118)
* Refactor blocks to remove subcategories, and order some in groups.
2017-10-13 15:19:02 -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
Abhijith Chatra 9de81793c1 RandomRange API update in docs (#98)
* Rearrange More.. API

* Fixing randomRange API update issues
2017-07-18 14:38:05 -07:00
Galen Nickel e8a4096fc8 Add touch note to button topics (#88)
* Add touch note to button topics

* Add side topic 'touch sensors' and linking from button topics

* Spelling fix, arg!

* let's fix a grammer glitch
2017-06-14 10:57:16 -07:00
Peli de Halleux 86032cac78 fixing light test 2017-06-09 13:25:55 -07:00
Peli de Halleux 993a1c72aa updated tests 2017-06-09 13:16:02 -07:00
Peli de Halleux e7950ad883 renaming temperature -> thermometer (#86)
* renaming temperature -> thermometer
moving buttons in own package

* fixing readme
2017-06-09 11:10:09 -07:00