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
Select Git revision
  • add_menu_vibration
  • blinkisync-as-preload
  • ch3/api-speed-eval2
  • ch3/dual-core
  • ch3/genapi-refactor
  • ch3/leds-api
  • ch3/splashscreen
  • dualcore
  • dx/flatten-config-module
  • dx/meh-bdf-to-stm
  • freertos-btle
  • genofire/ble-follow-py
  • koalo/bhi160-works-but-dirty
  • koalo/factory-reset
  • koalo/wip/i2c-for-python
  • master
  • msgctl/faultscreen
  • msgctl/textbuffer_api
  • plaetzchen/ios-workaround
  • rahix/bhi
  • rahix/bluetooth-app-favorite
  • rahix/bma
  • rahix/user-space-ctx
  • renze/hatchery_apps
  • renze/safe_mode
  • schleicher-test
  • schneider/212-reset-hardware-when-entering-repl
  • schneider/ancs
  • schneider/ble-buffers
  • schneider/ble-central
  • schneider/ble-ecg-stream-visu
  • schneider/ble-fixes-2020-3
  • schneider/ble-mini-demo
  • schneider/ble-stability
  • schneider/ble-stability-new-phy
  • schneider/bonding
  • schneider/bonding-fail-if-full
  • schneider/bootloader-update-9a0d158
  • schneider/deepsleep
  • schneider/deepsleep2
  • schneider/deepsleep4
  • schneider/default-main
  • schneider/freertos-list-debug
  • schneider/fundamental-test
  • schneider/iaq-python
  • schneider/ir
  • schneider/max30001
  • schneider/max30001-epicaridum
  • schneider/max30001-pycardium
  • schneider/maxim-sdk-update
  • schneider/mp-exception-print
  • schneider/mp-for-old-bl
  • schneider/png
  • schneider/schleicher-test
  • schneider/sdk-0.2.1-11
  • schneider/sdk-0.2.1-7
  • schneider/sleep-display
  • schneider/spo2-playground
  • schneider/stream-locks
  • schneider/v1.17-changelog
  • bootloader-v1
  • release-1
  • v0.0
  • v1.0
  • v1.1
  • v1.10
  • v1.11
  • v1.12
  • v1.13
  • v1.14
  • v1.15
  • v1.16
  • v1.17
  • v1.18
  • v1.2
  • v1.3
  • v1.4
  • v1.5
  • v1.6
  • v1.7
  • v1.8
  • v1.9
82 results

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
Select Git revision
  • analog_gpio
  • card10.cfg
  • ch3/dual-core
  • ch3/genapi-refactor
  • ch3/leds-api
  • config
  • debug_module
  • dir
  • dualcore
  • esb
  • esb_py
  • esb_squashed_nopy
  • fat
  • fatfs-generation
  • fd_ownership
  • fileapi
  • fix-intid
  • freertos-btle
  • fs-deinit
  • gpio_fix
  • hula
  • hwlock_pc
  • jailbreak
  • master
  • moar_blacklist
  • mx_printf
  • poc-reboot
  • schneider/mp-for-old-bl
  • stacksize
  • tidy
  • usb
31 results
Show changes
Showing
with 371 additions and 236 deletions
#include "epicardium.h"
#include "os/core.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void migration_delete_app_launchers(void)
{
int fd = epic_file_opendir("/");
struct epic_stat entry;
for (;;) {
epic_file_readdir(fd, &entry);
if (entry.type == EPICSTAT_NONE) {
// End
break;
}
const char *dot = strrchr(entry.name, '.');
if (dot && !strcmp(dot, ".py")) {
const char launcher[] = "# Launcher script for ";
char launcher_buf[strlen(launcher)];
int fd = epic_file_open(entry.name, "r");
if (fd >= 0) {
int n = epic_file_read(
fd, launcher_buf, sizeof(launcher_buf)
);
epic_file_close(fd);
if (n == (int)sizeof(launcher_buf) &&
!memcmp(launcher,
launcher_buf,
sizeof(launcher_buf))) {
LOG_INFO(
"migration",
"Delete old launcher %s",
entry.name
);
epic_file_unlink(entry.name);
}
}
}
}
epic_file_close(fd);
}
#pragma once
#include "FreeRTOS.h"
#include "os/mutex.h"
/* ---------- Dispatcher --------------------------------------------------- */
void vApiDispatcher(void *pvParameters);
void dispatcher_mutex_init(void);
extern struct mutex api_mutex;
extern TaskHandle_t dispatcher_task_id;
/* ---------- Lifecycle ---------------------------------------------------- */
void vLifecycleTask(void *pvParameters);
void return_to_menu(void);
/* ---------- Migration ---------------------------------------------------- */
void migration_delete_app_launchers(void);
epicardium/version-splash.png

15 KiB

source init.gdb
set confirm off
mon max32xxx mass_erase 0
mon max32xxx mass_erase 1
echo #### BOOTLOADER ####\n
load build/bootloader/bootloader.elf
echo #### EPICARDIUM ####\n
load build/epicardium/epicardium.elf
echo #### PYCARDIUM ####\n
load build/pycardium/pycardium.elf
reset
quit
source init.gdb
set confirm off
echo #### BOOTLOADER ####\n
load build/bootloader/bootloader.elf
reset
quit
source init.gdb
set confirm off
echo #### EPICARDIUM ####\n
load build/epicardium/epicardium.elf
echo #### PYCARDIUM ####\n
load build/pycardium/pycardium.elf
reset
quit
source init.gdb
set confirm off
echo #### EPICARDIUM ####\n
load build/epicardium/epicardium.elf
reset
quit
source init.gdb
set confirm off
echo #### PYCARDIUM ####\n
load build/pycardium/pycardium.elf
reset
quit
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
void *api_call_start(uint32_t id, void *args, uint32_t size) void *api_call_start(uint32_t id, void *args, uint32_t size)
{ {
// aquire semaphore // aquire semaphore
while (E_BUSY == SEMA_GetSema (API_CALL_SEMA)) ; while (E_BUSY == SEMA_GetSema(API_CALL_SEMA))
;
ApiCallSpace->id = id; ApiCallSpace->id = id;
ApiCallSpace->returning = 0; ApiCallSpace->returning = 0;
...@@ -20,7 +21,8 @@ void* api_call_bother_dispatcher (void* buf) ...@@ -20,7 +21,8 @@ void* api_call_bother_dispatcher (void* buf)
while (1) { while (1) {
// aquire semaphore // aquire semaphore
while (E_BUSY == SEMA_GetSema (API_CALL_SEMA)) ; while (E_BUSY == SEMA_GetSema(API_CALL_SEMA))
;
if (ApiCallSpace->returning == 1) { if (ApiCallSpace->returning == 1) {
break; break;
} }
......
...@@ -17,7 +17,8 @@ void __api_dispatch_call(uint32_t id, void*buffer); ...@@ -17,7 +17,8 @@ void __api_dispatch_call(uint32_t id, void*buffer);
void api_dispatcher() void api_dispatcher()
{ {
while (SEMA_GetSema(API_CALL_SEMA) == E_BUSY) {} while (SEMA_GetSema(API_CALL_SEMA) == E_BUSY) {
}
if (ApiCallSpace->returning == 1) { if (ApiCallSpace->returning == 1) {
SEMA_FreeSema(API_CALL_SEMA); SEMA_FreeSema(API_CALL_SEMA);
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
#include "api/api_dispatcher.h" #include "api/api_dispatcher.h"
static const gpio_cfg_t motor_pin = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE}; static const gpio_cfg_t motor_pin = {
PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE
};
void api_set_buzzer(uint8_t state) void api_set_buzzer(uint8_t state)
{ {
...@@ -23,7 +25,10 @@ void api_set_buzzer(uint8_t state) ...@@ -23,7 +25,10 @@ void api_set_buzzer(uint8_t state)
void api_set_led(uint8_t led, led_color_t color) void api_set_led(uint8_t led, led_color_t color)
{ {
printf("API: Changing color of led %d.\n", led); printf("API: Changing color of led %d.\n", led);
printf("Color { r: %3d, g: %3d, b: %3d }\n", color.red, color.green, color.blue); printf("Color { r: %3d, g: %3d, b: %3d }\n",
color.red,
color.green,
color.blue);
leds_set(led, color.red, color.green, color.blue); leds_set(led, color.red, color.green, color.blue);
leds_update(); leds_update();
} }
...@@ -31,7 +36,10 @@ void api_set_led(uint8_t led, led_color_t color) ...@@ -31,7 +36,10 @@ void api_set_led(uint8_t led, led_color_t color)
void api_test(char test0, short test1, int test2, long test3) void api_test(char test0, short test1, int test2, long test3)
{ {
printf("test0: %x, test1: %d, test2: %x, test3: %lx\n", printf("test0: %x, test1: %d, test2: %x, test3: %lx\n",
test0, (int)test1, test2, test3); test0,
(int)test1,
test2,
test3);
} }
int main(void) int main(void)
...@@ -44,7 +52,6 @@ int main(void) ...@@ -44,7 +52,6 @@ int main(void)
TMR_Delay(MXC_TMR1, MSEC(100), 0); TMR_Delay(MXC_TMR1, MSEC(100), 0);
} }
#if 0 #if 0
// Enable rxev on core1 // Enable rxev on core1
MXC_GCR->evten |= 0x20; MXC_GCR->evten |= 0x20;
......
source ../../.gdbinit source ../../init.gdb
set confirm off set confirm off
......
...@@ -50,18 +50,19 @@ def main(): ...@@ -50,18 +50,19 @@ def main():
f_client = cx.enter_context(open(args.client, "w")) f_client = cx.enter_context(open(args.client, "w"))
f_server = cx.enter_context(open(args.server, "w")) f_server = cx.enter_context(open(args.server, "w"))
print('#include "{}"\n'.format( print('#include "{}"\n'.format(os.path.basename(args.header)), file=f_client)
os.path.basename(args.header)
), file=f_client)
print("""\ print(
"""\
#include "{}" #include "{}"
void __api_dispatch_call(uint32_t id, void*buffer) void __api_dispatch_call(uint32_t id, void*buffer)
{{ {{
switch (id) {{""".format( switch (id) {{""".format(
os.path.basename(args.header) os.path.basename(args.header)
), file=f_server) ),
file=f_server,
)
for match in matcher.finditer(source): for match in matcher.finditer(source):
api_id = match.group("id") api_id = match.group("id")
...@@ -100,9 +101,12 @@ void {cdecl}({cargs}) ...@@ -100,9 +101,12 @@ void {cdecl}({cargs})
file=f_client, file=f_client,
) )
print("""\ print(
"""\
case {id}: case {id}:
{cdecl}(""".format(id=api_id, cdecl=api_decl), {cdecl}(""".format(
id=api_id, cdecl=api_decl
),
file=f_server, file=f_server,
) )
...@@ -122,18 +126,17 @@ void {cdecl}({cargs}) ...@@ -122,18 +126,17 @@ void {cdecl}({cargs})
print( print(
"""\ """\
*({type}*)(buffer + {offset})""".format( *({type}*)(buffer + {offset})""".format(
type=ty, type=ty, offset=" + ".join(api_args_sizes[:i]) if i > 0 else "0"
offset=" + ".join(api_args_sizes[:i]) if i > 0 else "0",
), ),
file=f_server, file=f_server,
end="", end="",
) )
print(""" print(
"""
); );
break;""".format( break;""".format(
cdecl=api_decl, cdecl=api_decl, args=", ".join(api_args_names)
args=", ".join(api_args_names),
), ),
file=f_server, file=f_server,
) )
...@@ -154,14 +157,17 @@ void {cdecl}({cargs}) ...@@ -154,14 +157,17 @@ void {cdecl}({cargs})
file=f_client, file=f_client,
) )
print("""\ print(
"""\
default: default:
printf("Error: API function %x is unknown!!\\n", {id}); printf("Error: API function %x is unknown!!\\n", {id});
break; break;
}} }}
}}""".format( }}""".format(
id=api_id, id=api_id
), file=f_server) ),
file=f_server,
)
if __name__ == "__main__": if __name__ == "__main__":
......
...@@ -6,16 +6,6 @@ ...@@ -6,16 +6,6 @@
#include "tmr_utils.h" #include "tmr_utils.h"
#include "api.h" #include "api.h"
void Core1_Start(void) {
//MXC_GCR->gp0 = (uint32_t)(&__isr_vector_core1);
MXC_GCR->gp0 = 0x10040000;
MXC_GCR->perckcn1 &= ~MXC_F_GCR_PERCKCN1_CPU1;
}
void Core1_Stop(void) {
MXC_GCR->perckcn1 |= MXC_F_GCR_PERCKCN1_CPU1;
}
int main(void) int main(void)
{ {
int count = 0; int count = 0;
...@@ -26,7 +16,7 @@ int main(void) ...@@ -26,7 +16,7 @@ int main(void)
printf("API Test.\n"); printf("API Test.\n");
printf("core0: Starting dispatcher on core1\n"); printf("core0: Starting dispatcher on core1\n");
Core1_Start(); core1_start();
TMR_Delay(MXC_TMR0, MSEC(100), 0); TMR_Delay(MXC_TMR0, MSEC(100), 0);
api_set_buzzer(1); api_set_buzzer(1);
......
file ../../build/hw-tests/bmatest/bmatest.elf
source ../../.gdbinit
source ../../init.gdb
file ../../build/hw-tests/bmatest/bmatest.elf
...@@ -64,7 +64,6 @@ int main(void) ...@@ -64,7 +64,6 @@ int main(void)
uint32_t poll_period = 5, test_dur_ms = 30000; uint32_t poll_period = 5, test_dur_ms = 30000;
uint16_t int_status; uint16_t int_status;
bma.intf_ptr = NULL; /* To attach your interface device reference */ bma.intf_ptr = NULL; /* To attach your interface device reference */
bma.delay_ms = card10_bosch_delay; bma.delay_ms = card10_bosch_delay;
bma.dev_id = BMA400_I2C_ADDRESS_SDO_LOW; bma.dev_id = BMA400_I2C_ADDRESS_SDO_LOW;
...@@ -77,7 +76,6 @@ int main(void) ...@@ -77,7 +76,6 @@ int main(void)
printf("BMA400 found with chip ID 0x%X\r\n", bma.chip_id); printf("BMA400 found with chip ID 0x%X\r\n", bma.chip_id);
} }
print_rslt(rslt); print_rslt(rslt);
rslt = bma400_soft_reset(&bma); rslt = bma400_soft_reset(&bma);
...@@ -138,6 +136,5 @@ int main(void) ...@@ -138,6 +136,5 @@ int main(void)
test_dur_ms -= poll_period; test_dur_ms -= poll_period;
} }
} }
} }
file ../../build/hw-tests/bmetest/bmetest.elf
source ../../.gdbinit
source ../../init.gdb
file ../../build/hw-tests/bmetest/bmetest.elf
...@@ -11,7 +11,9 @@ ...@@ -11,7 +11,9 @@
#include "gpio.h" #include "gpio.h"
#include "bme680.h" #include "bme680.h"
#include "bosch.h" #include "bosch.h"
#include "GUI_DEV/GUI_Paint.h" #include "gfx.h"
#include "framebuffer.h"
#include "display.h"
#include "Fonts/fonts.h" #include "Fonts/fonts.h"
#include "card10.h" #include "card10.h"
...@@ -63,8 +65,9 @@ int main(void) ...@@ -63,8 +65,9 @@ int main(void)
gas_sensor.power_mode = BME680_FORCED_MODE; gas_sensor.power_mode = BME680_FORCED_MODE;
/* Set the required sensor settings needed */ /* Set the required sensor settings needed */
set_required_settings = BME680_OST_SEL | BME680_OSP_SEL | BME680_OSH_SEL | BME680_FILTER_SEL set_required_settings = BME680_OST_SEL | BME680_OSP_SEL |
| BME680_GAS_SENSOR_SEL; BME680_OSH_SEL | BME680_FILTER_SEL |
BME680_GAS_SENSOR_SEL;
/* Set the desired sensor configuration */ /* Set the desired sensor configuration */
rslt = bme680_set_sensor_settings(set_required_settings, &gas_sensor); rslt = bme680_set_sensor_settings(set_required_settings, &gas_sensor);
...@@ -72,36 +75,47 @@ int main(void) ...@@ -72,36 +75,47 @@ int main(void)
/* Set the power mode */ /* Set the power mode */
rslt = bme680_set_sensor_mode(&gas_sensor); rslt = bme680_set_sensor_mode(&gas_sensor);
Color white = gfx_color(&display_screen, WHITE);
Color black = gfx_color(&display_screen, BLACK);
while (1) { while (1) {
TMR_Delay(MXC_TMR0, MSEC(1000), 0); TMR_Delay(MXC_TMR0, MSEC(1000), 0);
struct bme680_field_data data; struct bme680_field_data data;
rslt = bme680_get_sensor_data(&data, &gas_sensor); rslt = bme680_get_sensor_data(&data, &gas_sensor);
printf("T: %.2f degC, P: %.2f hPa, H %.2f %%rH ", data.temperature / 100.0l, printf("T: %.2Lf degC, P: %.2Lf hPa, H %.2Lf %%rH ",
data.pressure / 100.0l, data.humidity / 1000.0l ); data.temperature / 100.0l,
data.pressure / 100.0l,
data.humidity / 1000.0l);
char buf[128]; char buf[128];
sprintf(buf, "T: %.2f degC", data.temperature / 100.0l); sprintf(buf, "T: %.2Lf degC", data.temperature / 100.0l);
Paint_DrawString_EN(0, 0, buf, &Font16, 0x0000, 0xffff); gfx_puts(&Font16, &display_screen, 0, 0, buf, white, black);
sprintf(buf, "P: %.2f hPa", data.pressure / 100.0l); sprintf(buf, "P: %.2Lf hPa", data.pressure / 100.0l);
Paint_DrawString_EN(0, 16, buf, &Font16, 0x0000, 0xffff); gfx_puts(&Font16, &display_screen, 0, 16, buf, white, black);
sprintf(buf, "H: %.2f %%rH", data.humidity / 1000.0l); sprintf(buf, "H: %.2Lf %%rH", data.humidity / 1000.0l);
Paint_DrawString_EN(0, 32, buf, &Font16, 0x0000, 0xffff); gfx_puts(&Font16, &display_screen, 0, 32, buf, white, black);
//printf("%.2f,%.2f,%.2f\n", data.temperature / 100.0f, //printf("%.2f,%.2f,%.2f\n", data.temperature / 100.0f,
// data.pressure / 100.0f, data.humidity / 1000.0f ); // data.pressure / 100.0f, data.humidity / 1000.0f );
/* Avoid using measurements from an unstable heating setup */ /* Avoid using measurements from an unstable heating setup */
if (data.status & BME680_GASM_VALID_MSK) { if (data.status & BME680_GASM_VALID_MSK) {
printf(", G: %d ohms", data.gas_resistance); printf(", G: %ld ohms", data.gas_resistance);
sprintf(buf, "G: %d ohms", data.gas_resistance); sprintf(buf, "G: %ld ohms", data.gas_resistance);
Paint_DrawString_EN(0, 48, buf, &Font16, 0x0000, 0xffff); gfx_puts(
&Font16,
&display_screen,
0,
48,
buf,
white,
black
);
} }
LCD_Update(); gfx_update(&display_screen);
printf("\n"); printf("\n");
......