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

Target

Select target project
  • card10/firmware
  • annejan/firmware
  • astro/firmware
  • fpletz/firmware
  • gerd/firmware
  • fleur/firmware
  • swym/firmware
  • l/firmware
  • uberardy/firmware
  • wink/firmware
  • madonius/firmware
  • mot/firmware
  • filid/firmware
  • q3k/firmware
  • hauke/firmware
  • Woazboat/firmware
  • pink/firmware
  • mossmann/firmware
  • omniskop/firmware
  • zenox/firmware
  • trilader/firmware
  • Danukeru/firmware
  • shoragan/firmware
  • zlatko/firmware
  • sistason/firmware
  • datenwolf/firmware
  • bene/firmware
  • amedee/firmware
  • martinling/firmware
  • griffon/firmware
  • chris007/firmware
  • adisbladis/firmware
  • dbrgn/firmware
  • jelly/firmware
  • rnestler/firmware
  • mh/firmware
  • ln/firmware
  • penguineer/firmware
  • monkeydom/firmware
  • jens/firmware
  • jnaulty/firmware
  • jeffmakes/firmware
  • marekventur/firmware
  • pete/firmware
  • h2obrain/firmware
  • DooMMasteR/firmware
  • jackie/firmware
  • prof_r/firmware
  • Draradech/firmware
  • Kartoffel/firmware
  • hinerk/firmware
  • abbradar/firmware
  • JustTB/firmware
  • LuKaRo/firmware
  • iggy/firmware
  • ente/firmware
  • flgr/firmware
  • Lorphos/firmware
  • matejo/firmware
  • ceddral7/firmware
  • danb/firmware
  • joshi/firmware
  • melle/firmware
  • fitch/firmware
  • deurknop/firmware
  • sargon/firmware
  • markus/firmware
  • kloenk/firmware
  • lucaswerkmeister/firmware
  • derf/firmware
  • meh/firmware
  • dx/card10-firmware
  • torben/firmware
  • yuvadm/firmware
  • AndyBS/firmware
  • klausdieter1/firmware
  • katzenparadoxon/firmware
  • xiretza/firmware
  • ole/firmware
  • techy/firmware
  • thor77/firmware
  • TilCreator/firmware
  • fuchsi/firmware
  • dos/firmware
  • yrlf/firmware
  • PetePriority/firmware
  • SuperVirus/firmware
  • sur5r/firmware
  • tazz/firmware
  • Alienmaster/firmware
  • flo_h/firmware
  • baldo/firmware
  • mmu_man/firmware
  • Foaly/firmware
  • sodoku/firmware
  • Guinness/firmware
  • ssp/firmware
  • led02/firmware
  • Stormwind/firmware
  • arist/firmware
  • coon/firmware
  • mdik/firmware
  • pippin/firmware
  • royrobotiks/firmware
  • zigot83/firmware
  • mo_k/firmware
106 results
Show changes
Showing
with 560 additions and 14348 deletions
......@@ -18,9 +18,11 @@ in stdenv.mkDerivation rec {
bash
crc16
gcc-arm-embedded
git
meson
ninja
py
py.pkgs.pillow
];
src = ./.;
buildCommand = ''
......@@ -33,7 +35,7 @@ in stdenv.mkDerivation rec {
chmod -R +w .
# The nix sandbox does not have /usr/bin/env bash, patch things up.
for f in lib/micropython/*.sh; do
for f in lib/micropython/*.sh tools/*.sh; do
patchShebangs "$f"
done
......@@ -41,10 +43,13 @@ in stdenv.mkDerivation rec {
meson --cross-file card10-cross.ini "$build"
ninja -C "$build" -j $NIX_BUILD_CORES
# Copy artifacts to derivation outputs.
install -D -m 444 "$build/bootloader/bootloader.elf" -t "$out/bootloader"
install -D -m 444 "$build/pycardium/pycardium_epicardium.bin" -t "$out/pycardium"
install -D -m 444 "$build/epicardium/epicardium.elf" -t "$out/epicardium"
install -D -m 444 "$build/pycardium/pycardium.elf" -t "$out/pycardium"
# Copy ELFs for debugging
install -D -m 444 "$build/bootloader/bootloader.elf" -t "$out/lib/bootloader.elf"
install -D -m 444 "$build/epicardium/epicardium.elf" -t "$out/lib/epicardium.elf"
install -D -m 444 "$build/pycardium/pycardium.elf" -t "$out/lib/pycardium.elf"
# Create new flash contents
install -D -m 444 "$build/pycardium/pycardium_epicardium.bin" "$out/card10/card10.bin"
install -m 444 preload/*.py -t $out/card10/
cp -ar preload/apps $out/card10/
'';
}
import ws2812, gpio, bluetooth, time, display
from micropython import const
_IRQ_GATTS_WRITE = const(3)
WS2812_SERVICE_UUID = \
bluetooth.UUID("23238000-2342-2342-2342-234223422342")
SET_ALL = (
bluetooth.UUID("23238001-2342-2342-2342-234223422342"),
bluetooth.FLAG_WRITE
)
WS2812_SERVICE = (
WS2812_SERVICE_UUID,
(SET_ALL,)
)
def irq(event, data):
if event == _IRQ_GATTS_WRITE:
conn_handle, value_handle = data
value = ble.gatts_read(value_handle)
ws2812.set_all(gpio.WRISTBAND_3, [value] * 3)
if __name__ == "__main__":
display.open().backlight(0)
gpio.set_mode(gpio.WRISTBAND_3, gpio.mode.OUTPUT)
ble = bluetooth.BLE()
ble.active(True)
ble.irq(irq)
ble.gatts_register_services((WS2812_SERVICE,))
print("Waiting for connection!")
while True:
time.sleep(1)
#!/usr/bin/env python3
import bluepy
import time
import colorsys
# Change this to the MAC of your card10
p = bluepy.btle.Peripheral("CA:4D:10:01:ff:64")
c = p.getCharacteristics(
uuid='23238001-2342-2342-2342-234223422342')[0]
hue = 0
while 1:
r,g,b = colorsys.hsv_to_rgb(hue, 1, 0.1)
c.write(b"%c%c%c" %
(int(r*255), int(g*255), int(b*255)), True)
time.sleep(.1)
hue += 0.1
FROM ubuntu
RUN apt-get update && apt-get -y install gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi python3 python3-pip ninja-build git
RUN pip3 install meson crc16 pillow
VOLUME /firmware
WORKDIR /firmware
CMD ./bootstrap.sh && ninja -C build && chown -R --reference=/firmware build
FROM ubuntu:bionic
FROM ubuntu:focal
RUN set -e -x ;\
export DEBIAN_FRONTEND=noninteractive ;\
......@@ -10,7 +10,7 @@ RUN set -e -x ;\
llvm \
python3-pip ;\
pip3 install \
clang \
clang==10.0.1 \
sphinx \
sphinx_rtd_theme ;\
rm -rf /var/lib/apt/lists
......
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#define MXC_ASSERT_ENABLE
#include "mxc_assert.h"
#include "max32665.h"
#include <assert.h>
/* CMSIS keeps a global updated with current system clock in Hz */
#define configCPU_CLOCK_HZ ((unsigned long)96000000)
......@@ -51,7 +50,10 @@
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_uxTaskGetStackHighWaterMark 1
#define INCLUDE_xTimerPendFunctionCall 1
#define INCLUDE_xSemaphoreGetMutexHolder 1
/* Allow static allocation of data structures */
#define configSUPPORT_STATIC_ALLOCATION 1
......@@ -69,7 +71,7 @@
#define xPortSysTickHandler SysTick_Handler
/* Assert */
#define configASSERT(x) MXC_ASSERT(x)
#define configASSERT(x) assert(x)
/* Tickless idle hooks */
typedef uint32_t TickType_t;
......
This diff is collapsed.
This diff is collapsed.
......@@ -27,3 +27,12 @@ void *_api_call_start(api_id_t id, uintptr_t size);
* - Pointer to a buffer containing the return value
*/
void *_api_call_transact(void *buffer);
/*
* Fetch arguments from the API buffer. This function will only work properly
* directly after startup of core 1. If api_fetch_args() is called after other
* calls have already happened, it will return -1.
*
* Otherwise it will return the length of data which was read.
*/
int api_fetch_args(char *buf, size_t cnt);
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.