From 9ed36439228b180a554bbaa504e03ffd56363968 Mon Sep 17 00:00:00 2001 From: Camila Date: Mon, 11 Mar 2024 13:19:19 +0100 Subject: [PATCH] Changes required for new Spresense SDK 3.2.0 - Wrapped main function in spresense_main - video_uninitialize now requires dev path as parameter --- ports/cxd56/Makefile | 1 - ports/cxd56/common-hal/camera/Camera.c | 2 +- ports/cxd56/supervisor/port.c | 7 +++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ports/cxd56/Makefile b/ports/cxd56/Makefile index c6203350d127f..48fecbfacf5df 100644 --- a/ports/cxd56/Makefile +++ b/ports/cxd56/Makefile @@ -73,7 +73,6 @@ CFLAGS += \ -DCONFIG_WCHAR_BUILTIN \ -DCONFIG_HAVE_DOUBLE \ -DNDEBUG \ - -Dmain=spresense_main \ -D_estack=__stack \ -DCIRCUITPY_BOARD_ID="\"$(BOARD)\"" \ -c \ diff --git a/ports/cxd56/common-hal/camera/Camera.c b/ports/cxd56/common-hal/camera/Camera.c index 4f468a537b956..65ab3b89f674f 100644 --- a/ports/cxd56/common-hal/camera/Camera.c +++ b/ports/cxd56/common-hal/camera/Camera.c @@ -169,7 +169,7 @@ void common_hal_camera_deinit(camera_obj_t *self) { return; } - video_uninitialize(); + video_uninitialize(camera_dev.devpath); close(camera_dev.fd); camera_dev.fd = -1; diff --git a/ports/cxd56/supervisor/port.c b/ports/cxd56/supervisor/port.c index ecb16d77da91b..21837fc710271 100644 --- a/ports/cxd56/supervisor/port.c +++ b/ports/cxd56/supervisor/port.c @@ -165,3 +165,10 @@ void port_interrupt_after_ticks(uint32_t ticks) { void port_idle_until_interrupt(void) { // TODO: Implement sleep. } + +// Wrap main in spresense_main +extern void main(void); +extern int spresense_main(int argc, FAR char *argv[]); +int spresense_main(int argc, FAR char *argv[]) { + main(); +} \ No newline at end of file