lancaster-university / codal Goto Github PK
View Code? Open in Web Editor NEWThe build system for Component Oriented Device Abstraction Layer (CODAL) devices.
Home Page: https://lancaster-university.github.io/codal/
License: MIT License
The build system for Component Oriented Device Abstraction Layer (CODAL) devices.
Home Page: https://lancaster-university.github.io/codal/
License: MIT License
I'm trying to get the ATMEGA328P_ARDUINO_UNO target compiling on a mac.
I've got the latest Xcode CLI tools, but I'm running into the following issue:
-- The ASM compiler identification is AppleClang
-- Didn't find assembler
CMake Error at CMakeLists.txt:31 (enable_language):
No CMAKE_ASM_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "ASM" or the CMake cache entry CMAKE_ASM_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "/Users/sam/pxt-arduino-uno/libs/blocksprj/built/codal/build/CMakeFiles/CMakeOutput.log".
Any ideas?
hiya, can the manger please add tannewt (scott shawcroft) to this repo? he's working at adafruit on samd circuitplayground support and can help with and be helped by access :)
https://github.com/tannewt
Just noticed the micro:bit version of build.py has an extra flag: lancaster-university/microbit-v2-samples@9da3427
We might want to add it to this repo as well, specially if micro:bit adopts the bootstrap.
Some libraries might not necessarily be a target dependency but users may require them. We should support the specification of additional libraries to build and link against through codal.json.
Getting a compile error when trying out the new Audio code. Looks like there is a reference to SERIAL_DEBUG that isn't hidden behind and ifdef in that file.
Need to add automatic deletion of timer listeners upon event fulfilment.
This is very helpful to understand which version of CODAL tools is running.
To be able to automatically put the device in deep sleep to save energy. @finneyj I recall you looked into this a while ago.
Limor pointed us to https://github.com/adafruit/Adafruit_SleepyDog/
If you drop a .vscode/tasks.json
file with the following content, a user can simply do Ctrl+Shift+B to build in VS Code.
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "python build.py",
"problemMatcher": [
"$msCompile"
]
}
]
}
The default handlers are pretty useless, and mostly just spin wait.
These are defined in the device startup script (for mbed):
Should be pretty trivial to override as they are weak symbols.
If I execute python build.py
immediately after itself, I would have expected a much faster build time. It seems to be rebuilding all the files all over again.
Running this program on CPX + SG92R on pin A1,
#include "CircuitPlayground.h"
CircuitPlayground cplay;
int main()
{
int status = 0;
while(1)
{
cplay.io.led.setDigitalValue(status);
cplay.io.a1.setServoValue(30 + rand() % 15);
cplay.sleep(20);
status = !status;
}
}
title says it all. See ManagedString constructor for example:
ManagedString::ManagedString(StringData *p)
{
ptr = p;
ptr->incr();
}
The sensor was rotated so CODAL needs to account for it.
Request for a general purpose "AnalogButton" that wraps an analog sensor into a button. Currently, DeviceButton is meant for a digital pin and does not take into account thresholds set on the analog sensor.
For example, we could mount a button on a light sensor and just handle a "light click"!
Random currently returns always 0.
Some effects might use a bit of debouncing to avoid multiple occurences.
From @finneyj :
Feels like we need a bit of a precedent on when we use fail-fast techniques like this and when we try to be tolerant and NOP etc to keep kids' code running... hmmm.....
If we go down the fail-fast route, maybe we should look at more specific panic codes, and make better use of DMESG
to provide feedback... thoughts?
The way I look at it, is that if we or some other C++ package writer makes a mistake, then it should be panic. Otherwise, we get issues that are difficult to debug. This includes situations when we run out of memory while allocating system resources, or we run out of component IDs. Maybe we can make this optional - i.e., have a macro PANIC(code, "message")
that can be compiled to nothing.
If user supplies values out of range we should either ignore or clamp (i.e., IMHO analogWrite(1500)
should be treated as analogWrite(1023)
) - this is under assumption that it's easier to debug for the user if the code does nothing rather than crashes. This is especially true for stuff accessible from blocks.
This is in line with JavaScript semantics - i.e., undefined / 7
is NaN
, some_array[100000]
is undefined
etc. One place where JavaScript throws is method call on null
. But I don't think we want to deviate from JS semantics here.
The distinction between error in C++ and error in user code is of course up to a specific runtime, but I think it will be fairly clear in most cases.
Push into stack, reduce TCB size.
I'll create a list here of missing patches from https://github.com/lancaster-university/microbit-v2-sample that might require some discussion before merging them here:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.