diff --git a/.vscode/tasks.json b/.vscode/tasks.json index f92d424..88b0470 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,7 +4,7 @@ { "label": "Initialize QEMU Build Directory", "type": "shell", - "command": "mkdir -p ${BFBUILD_QEMU} && cd ${BFBUILD_QEMU} && ${BFAOS}/hake/hake.sh -s ${BFAOS} && make -j7 QEMU", + "command": "source ${HOME}/envvars.sh && mkdir -p ${BFBUILD_QEMU} && cd ${BFBUILD_QEMU} && ${BFAOS}/hake/hake.sh -s ${BFAOS} && make -j7 QEMU", "group": { "kind": "build", "isDefault": true @@ -13,7 +13,7 @@ { "label": "Build and Run QEMU", "type": "shell", - "command": "cd ${BFBUILD_QEMU} && make qemu_a57 | tee ${BFBUILD_QEMU}/full_output.log", + "command": "source ${HOME}/envvars.sh && cd ${BFBUILD_QEMU} && make qemu_a57 | tee ${BFBUILD_QEMU}/full_output.log", "group": { "kind": "build", "isDefault": true @@ -22,7 +22,7 @@ { "label": "Initialize Toradex Build Directory", "type": "shell", - "command": "mkdir -p ${BFBUILD} && cd ${BFBUILD} && ${BFAOS}/hake/hake.sh -s ${BFAOS} -a armv8 && make -j7 QEMU", + "command": "source ${HOME}/envvars.sh && mkdir -p ${BFBUILD} && cd ${BFBUILD} && ${BFAOS}/hake/hake.sh -s ${BFAOS} -a armv8 && make -j7 QEMU", "group": { "kind": "build", "isDefault": true @@ -31,7 +31,7 @@ { "label": "Build and Run Toradex", "type": "shell", - "command": "cd ${BFBUILD} && make -j7 imx8x && make usbboot_imx8x", + "command": "source ${HOME}/envvars.sh && cd ${BFBUILD} && make -j7 imx8x && make usbboot_imx8x", "group": { "kind": "build", "isDefault": true diff --git a/usr/shelly/Hakefile b/usr/shelly/Hakefile index 532146f..562fc05 100644 --- a/usr/shelly/Hakefile +++ b/usr/shelly/Hakefile @@ -14,6 +14,6 @@ { target = "shelly", cFiles = [ "shelly.c" ], - addLibraries = [ "lpuart" ] + addLibraries = [ "lpuart", "gic_dist" ] } ] diff --git a/usr/shelly/shelly.c b/usr/shelly/shelly.c index ae77a16..9469dfe 100644 --- a/usr/shelly/shelly.c +++ b/usr/shelly/shelly.c @@ -14,8 +14,9 @@ #include #include "shelly.h" +__attribute__((__used__)) static void shelly_interrupt_handler(void * arg) { - struct shelly_st shelly_s = (struct shelly_st) arg; + // struct shelly_st * shelly_s = (struct shelly_st *) arg; debug_printf("[shelly_interrupt_handler]!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); return; } @@ -38,7 +39,7 @@ int main(int argc, char *argv[]) struct gic_dist_s * gic_s; //TODO: map gic space - err = gic_dist_init(gic_s, NULL); + err = gic_dist_init(&gic_s, NULL); if (err_is_fail(err)) USER_PANIC_ERR(err, "couln't init gic_dist interrupts"); struct lpuart_s * uart_s; @@ -51,10 +52,10 @@ int main(int argc, char *argv[]) err = inthandler_alloc_dest_irq_cap(IMX8X_UART3_INT, &inter_cap); if (err_is_fail(err)) USER_PANIC_ERR(err, "couln't alloc dest cap"); - struct waitset ws = get_default_waitset() + struct waitset * ws = get_default_waitset(); // waitset_init(&ws); - err = inthandler_setup(inter_cap, &ws, MKCLOSURE(shelly_interrupt_handler, shelly_s)); + err = inthandler_setup(inter_cap, ws, MKCLOSURE(shelly_interrupt_handler, (void *) &shelly_s)); if (err_is_fail(err)) USER_PANIC_ERR(err, "couln't setup interrupt handler"); err = gic_dist_enable_interrupt(gic_s, IMX8X_UART3_INT, 0b11111111, 0);