firmware merge requestshttps://git.flow3r.garden/card10/firmware/-/merge_requests2023-08-22T12:22:17Zhttps://git.flow3r.garden/card10/firmware/-/merge_requests/510Make it work on new ubuntu (22.04) by changing python module to crcmod, and...2023-08-22T12:22:17ZTadeusz MWMake it work on new ubuntu (22.04) by changing python module to crcmod, and...Make it work on new ubuntu (22.04) by changing python module to crcmod, and adding git's safe.directory to bootstrap.sh, fix ubuntu's version in DockerfileMake it work on new ubuntu (22.04) by changing python module to crcmod, and adding git's safe.directory to bootstrap.sh, fix ubuntu's version in Dockerfilehttps://git.flow3r.garden/card10/firmware/-/merge_requests/509build: Fix Meson warnings2023-08-18T01:55:48ZFrançois Revolbuild: Fix Meson warningsWARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.
DEPRECATION: c_args in the [properties] section of the machine file is deprecated, use the [built-in options] sectio...WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.
DEPRECATION: c_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
DEPRECATION: c_link_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.https://git.flow3r.garden/card10/firmware/-/merge_requests/322WIP: Tvbgone fixes2023-08-04T21:42:51ZFrançois RevolWIP: Tvbgone fixesCurrent patches required to use the IR LED for TV-B-GONE.
Still missing PWM support in python.Current patches required to use the IR LED for TV-B-GONE.
Still missing PWM support in python.v1.19rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/507Draft: "User-space" CTX2022-04-12T19:31:39Zrahixcard10@rahix.deDraft: "User-space" CTXAdd python API for [CTX vector graphics](https://ctx.graphics). **This is a work-in-progress!!!**
There is still lot's missing, see the todo list below. That said, I've opened this PR so people can start playing with CTX on card10. Y...Add python API for [CTX vector graphics](https://ctx.graphics). **This is a work-in-progress!!!**
There is still lot's missing, see the todo list below. That said, I've opened this PR so people can start playing with CTX on card10. You can download a `card10.bin` for this MR from the "Exposed Artifacts" under the CI pipeline below. Documentation is null at the moment, but you can probably get quite far by reading the [HTML5 Canvas Docs](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D) and consulting
```python
import ctx_graphics
for e in dir(ctx_graphics.Ctx): print(e)
```
on card10 for method and constant names.
As a kick-start, here is some example code:
```python
import ctx_graphics, display, color
ctx = ctx_graphics.Ctx()
# Global Settings
ctx.line_width(5)
ctx.line_cap(ctx.CAP_ROUND)
ctx.line_join(ctx.JOIN_ROUND)
ctx.font_size(30)
ctx.font("ctx-mono")
ctx.text_align(ctx.TEXT_ALIGN_CENTER)
ctx.text_baseline(ctx.TEXT_BASELINE_MIDDLE)
with display.open() as d:
d.clear()
ctx.save()
# Some Lines with nice joints
ctx.stroke_color(color.CHAOSBLUE)
ctx.move_to(10, 10).line_to(10, 70).line_to(150, 70).line_to(150, 10).stroke()
# Draw a rectangle which perfectly fits the text
width = ctx.text_width("Hello CTX!") + 4
ctx.color(color.WHITE).rectangle(80 - width / 2, 20, width, 40).fill()
# Draw some text!
ctx.color(color.CAMPGREEN).fill_text("Hello CTX!", 80, 40)
ctx.restore()
ctx.update(d)
d.update()
```
## TODO
- [ ] Finish covering relevant API surface
- [ ] Implement alpha for color functions
- [ ] Take colors in many formats
- [ ] Cleanup the CTX when the python object gets garbage collected
- [ ] Improve API ergonomicshttps://git.flow3r.garden/card10/firmware/-/merge_requests/508tools: add IAQ example in Python2022-01-02T15:50:41Zschneidertools: add IAQ example in Pythonhttps://git.flow3r.garden/card10/firmware/-/merge_requests/262Add a framebuffer overlay for OS functions2021-12-25T18:52:30ZStefan HaunAdd a framebuffer overlay for OS functionsFixes #131
The API will is unchanged except for:
* add a function to select the overlay FB after opening the display
* a "fullscreen" option that disables the overlay display
Enhancement: The lifecycle management should disabl...Fixes #131
The API will is unchanged except for:
* add a function to select the overlay FB after opening the display
* a "fullscreen" option that disables the overlay display
Enhancement: The lifecycle management should disable the fullscreen before starting another application.swymswymhttps://git.flow3r.garden/card10/firmware/-/merge_requests/281Epi-/Pycardium function to read battery discharge current2021-12-25T18:52:28ZWoazboatEpi-/Pycardium function to read battery discharge currentAdd an epicardium function to read the battery discharge current (the currently available `epic_read_battery_current` function only reads the charging current according to the PMIC datasheet).
\+ fix incorrect AMUX channel in the `ep...Add an epicardium function to read the battery discharge current (the currently available `epic_read_battery_current` function only reads the charging current according to the PMIC datasheet).
\+ fix incorrect AMUX channel in the `epic_read_chargein_current`
\+ add a missing case (battery discharge current) to the AMUX read switch
\+ documentation improvementsrahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/255ble: card10 svc - add lcd backlight brightness2021-12-25T18:52:26Zgenofireble: card10 svc - add lcd backlight brightness- [x] impl
- [x] test
- [x] doku
- [x] lint- [x] impl
- [x] test
- [x] doku
- [x] lintrahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/284review of analog clock app2021-12-25T18:52:24ZHinerkreview of analog clock app- remove Time Class since it is not used
- remove unused variables from Clock class- remove Time Class since it is not used
- remove unused variables from Clock classhttps://git.flow3r.garden/card10/firmware/-/merge_requests/306Add menu vibration2021-12-25T18:52:23ZPhileasAdd menu vibrationThis merge request
- add vibration to the menu
- add `smooth_vibration` module for introducing common vibration patterns/mode
I've basically experimented a bit with coming up with ways to trigger the vibration motor.
This is super pri...This merge request
- add vibration to the menu
- add `smooth_vibration` module for introducing common vibration patterns/mode
I've basically experimented a bit with coming up with ways to trigger the vibration motor.
This is super primitive.
- [ ] menu timeout doesn't trigger timeout vibration
- [ ] more sophisticated patterns for vibration motor possible?
- [ ] should we have different vibration modi for going up and down
- [ ] could we add a vibration mode for when you cycled through the entire menu maybe?
- [ ] is the select vibration acceptable
- [ ] (how) should we make vibration configurable?https://git.flow3r.garden/card10/firmware/-/merge_requests/264feature(power) Calculate the battery capacity2021-12-25T18:52:19ZStefan Haunfeature(power) Calculate the battery capacityhttps://git.flow3r.garden/card10/firmware/-/merge_requests/266Display Backlight: automatically adjust to ambient sensor reading2021-12-25T18:52:18ZcsDisplay Backlight: automatically adjust to ambient sensor readingThis registers a Task, reading the ambient light sensor and adjusting
the display backlight accordingly
fixes #95This registers a Task, reading the ambient light sensor and adjusting
the display backlight accordingly
fixes #95https://git.flow3r.garden/card10/firmware/-/merge_requests/256Add multiple font support to `print`2021-12-25T18:52:17ZmehAdd multiple font support to `print`This also adds a new font, the API changes are backwards compatible so it should be fine, I will also leave here a font converter from BDF to STM whatever.
```rust
use std::{iter, env, error::Error, io};
use itertools::Itertools;
use bd...This also adds a new font, the API changes are backwards compatible so it should be fine, I will also leave here a font converter from BDF to STM whatever.
```rust
use std::{iter, env, error::Error, io};
use itertools::Itertools;
use bdf;
const CHARSET: &[char] = &[' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~'];
fn main() -> Result<(), Box<dyn Error>> {
let name = env::args().nth(1).expect("no font name provided");
let font = bdf::read(io::stdin())?;
println!("#include \"fonts.h\"");
println!("const uint8_t {name}_Table[] =", name = name);
println!("{{");
for (&ch, glyph) in CHARSET.iter().map(|ch| (ch, font.glyphs().get(ch).unwrap())) {
println!();
println!("\t// @{codepoint} {ch:?} ({width} pixels wide)",
codepoint = ch as usize,
ch = ch,
width = glyph.width());
for y in 0 .. glyph.height() {
print!("\t");
let mut draw = String::new();
for bits in &iter::repeat(false).take(glyph.bounds().x as usize)
.chain((0 .. glyph.width()).map(|x| glyph.map().get(x, y)))
.chunks(8)
{
let mut bits = bits.collect::<Vec<_>>();
if bits.len() < 8 {
for _ in 0 .. 8 - bits.len() {
bits.push(false);
}
}
let byte = bits.into_iter()
.rev().enumerate()
.fold(0, |acc, (i, b)| acc | ((b as u8) << i));
draw.push_str(&format!("{1:00$b}", glyph.width() as usize, byte));
print!("0x{:02X}, ", byte);
}
println!("//{}", draw.replace("1", "#").replace("0", " "));
}
// Print the right amount of empty lines.
for _ in 0 .. font.bounds().y.abs() + glyph.bounds().y {
for _ in 0 .. (glyph.width() + glyph.bounds().x as u32) / 8 {
print!("0x{:02X}, ", 0);
}
println!();
}
}
println!("}};");
println!();
println!("sFONT {name} = {{ {name}_Table, {width}, {height} }};",
name = name,
width = font.bounds().width,
height = font.bounds().height);
Ok(())
}
```https://git.flow3r.garden/card10/firmware/-/merge_requests/191Debug module2021-12-25T18:52:16ZswymDebug modulesome functions might be useful during development, but maybe should not be present in releases. Those could be placed in this module.some functions might be useful during development, but maybe should not be present in releases. Those could be placed in this module.https://git.flow3r.garden/card10/firmware/-/merge_requests/317support more bhi160 sensors2021-12-25T18:52:13ZFloriansupport more bhi160 sensorsThis adds support for the step counter, the remaining vector sensors "gravity" and "linear acceleration" and the three quaternion rotation sensors.
It does also remove the LOG_WARN statements from bhi160_handle_packet, since logging whi...This adds support for the step counter, the remaining vector sensors "gravity" and "linear acceleration" and the three quaternion rotation sensors.
It does also remove the LOG_WARN statements from bhi160_handle_packet, since logging while holding a hwlock seems to tend to deadlock.rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/297Handle button interrupts in epicardium + Add button callbacks to pycardium2021-11-16T22:25:07ZWoazboatHandle button interrupts in epicardium + Add button callbacks to pycardiumDepends on/includes !73
Parameter passing from core0 to core1 is very ad-hoc and could/should be improved in the future (related to #35)
Shortcomings in micropython:
* Scheduled callbacks are not processed while sleeping (utime.sleep)...Depends on/includes !73
Parameter passing from core0 to core1 is very ad-hoc and could/should be improved in the future (related to #35)
Shortcomings in micropython:
* Scheduled callbacks are not processed while sleeping (utime.sleep)
* Only one callback is processed per python statement (?)
```
while True:
utime.sleep(1) # Only one queued callback event will be handled per loop iteration
```v1.19rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/462feat(g_watch): Add ANCS support2021-04-02T20:04:37Zschneiderfeat(g_watch): Add ANCS supportMore a demo of what is possible now. I'm not sure if we should merge this just like that.
An iDevice which is paired to the card10 will now automatically try to connect as fast as possible independent of what the user might want. Maybe ...More a demo of what is possible now. I'm not sure if we should merge this just like that.
An iDevice which is paired to the card10 will now automatically try to connect as fast as possible independent of what the user might want. Maybe we should hide this behind an option menu or even make it it's own app?
![g-watch-ancs](/uploads/2604222c993731db4473f18a1474afb7/g-watch-ancs.mp4)https://git.flow3r.garden/card10/firmware/-/merge_requests/235Add picture viewer to preload2021-02-19T14:38:21ZDeurknopAdd picture viewer to preloadThe preloaded image is missing a picture viewer. I have written one.The preloaded image is missing a picture viewer. I have written one.https://git.flow3r.garden/card10/firmware/-/merge_requests/260blinkisync as preload2020-05-21T15:11:55Ztorbenblinkisync as preloadblinkisync is already in hatchery but would be nice to have it as preload aswell.blinkisync is already in hatchery but would be nice to have it as preload aswell.https://git.flow3r.garden/card10/firmware/-/merge_requests/348feat(bma): Add initial support for BMA4002020-02-08T23:13:19ZMichael Meinelfeat(bma): Add initial support for BMA400This merge enables BMA400 support:
- configure device, set power mode
- enable interrupts
- read acceleration and interrupts
Currently, support is implemented for detection of taps and orientation change.This merge enables BMA400 support:
- configure device, set power mode
- enable interrupts
- read acceleration and interrupts
Currently, support is implemented for detection of taps and orientation change.