mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #2530 from openmv/micropython_clean_patches
Some checks are pending
🔎 Check Code Formatting / formatting-check (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_GIGA) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_NANO_33_BLE_SENSE) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_NANO_RP2040_CONNECT) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_NICLA_VISION) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_PORTENTA_H7) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV2) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV3) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV4) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV4P) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMVPT) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV_RT1060) (push) Waiting to run
🔥 Firmware Build / code-size-report (push) Blocked by required conditions
🔥 Firmware Build / stable-release (push) Blocked by required conditions
🔥 Firmware Build / development-release (push) Blocked by required conditions
Some checks are pending
🔎 Check Code Formatting / formatting-check (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_GIGA) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_NANO_33_BLE_SENSE) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_NANO_RP2040_CONNECT) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_NICLA_VISION) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_PORTENTA_H7) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV2) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV3) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV4) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV4P) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMVPT) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV_RT1060) (push) Waiting to run
🔥 Firmware Build / code-size-report (push) Blocked by required conditions
🔥 Firmware Build / stable-release (push) Blocked by required conditions
🔥 Firmware Build / development-release (push) Blocked by required conditions
micropython: Switch to openmv-1.24.0 branch.
This commit is contained in:
commit
4b95fe18a2
@ -1 +1 @@
|
||||
Subproject commit 5adf65b0298ef6f1cc3300e78bb4197b021a5e25
|
||||
Subproject commit e9937040c94dcf05b762f91f816debceffb80507
|
||||
@ -1,20 +0,0 @@
|
||||
static const char fresh_main_py[] =
|
||||
"# Blinky example\n"
|
||||
"\n"
|
||||
"import time\n"
|
||||
"from machine import Pin\n"
|
||||
"\n"
|
||||
"# This is the only LED pin available on the Nano RP2040,\n"
|
||||
"# other than the RGB LED connected to Nina WiFi module.\n"
|
||||
"led = Pin(6, Pin.OUT)\n"
|
||||
"\n"
|
||||
"while (True):\n"
|
||||
" led.on()\n"
|
||||
" time.sleep_ms(150)\n"
|
||||
" led.off()\n"
|
||||
" time.sleep_ms(100)\n"
|
||||
" led.on()\n"
|
||||
" time.sleep_ms(150)\n"
|
||||
" led.off()\n"
|
||||
" time.sleep_ms(600)\n"
|
||||
;
|
||||
@ -1,97 +0,0 @@
|
||||
static const char fresh_main_py[] =
|
||||
"# This work is licensed under the MIT license.\n"
|
||||
"# Copyright (c) 2013-2024 OpenMV LLC. All rights reserved.\n"
|
||||
"# https://github.com/openmv/openmv/blob/master/LICENSE\n"
|
||||
"#\n"
|
||||
"# Pure Thermal Example Script\n"
|
||||
"#\n"
|
||||
"# Thanks for buying the Pure Thermal OpenMV! This example script shows off thermal video\n"
|
||||
"# overlay onto the color camera image and driving the attached LCD screen and HDMI output.\n"
|
||||
"\n"
|
||||
"import sensor\n"
|
||||
"import image\n"
|
||||
"import time\n"
|
||||
"import display\n"
|
||||
"import fir\n"
|
||||
"import math\n"
|
||||
"import tfp410\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"# Color Tracking Thresholds (Grayscale Min, Grayscale Max)\n"
|
||||
"threshold_list = [(200, 255)]\n"
|
||||
"\n"
|
||||
"sensor.reset()\n"
|
||||
"sensor.set_pixformat(sensor.RGB565)\n"
|
||||
"sensor.set_framesize(sensor.WVGA)\n"
|
||||
"time.sleep_ms(50)\n"
|
||||
"\n"
|
||||
"fir.init(fir.FIR_LEPTON)\n"
|
||||
"fir_img = image.Image(fir.width(), fir.height(), sensor.GRAYSCALE)\n"
|
||||
"time.sleep_ms(50)\n"
|
||||
"\n"
|
||||
"lcd = display.RGBDisplay(framesize=display.FWVGA, refresh=60)\n"
|
||||
"lcd.backlight(True)\n"
|
||||
"hdmi = tfp410.TFP410()\n"
|
||||
"time.sleep_ms(50)\n"
|
||||
"\n"
|
||||
"alpha_pal = image.Image(256, 1, sensor.GRAYSCALE)\n"
|
||||
"for i in range(256):\n"
|
||||
" alpha_pal[i] = int(math.pow((i / 255), 2) * 255)\n"
|
||||
"\n"
|
||||
"to_min = None\n"
|
||||
"to_max = None\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"def map_g_to_temp(g):\n"
|
||||
" return ((g * (to_max - to_min)) / 255.0) + to_min\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"while True:\n"
|
||||
" img = sensor.snapshot()\n"
|
||||
" # ta: Ambient temperature\n"
|
||||
" # ir: Object temperatures (IR array)\n"
|
||||
" # to_min: Minimum object temperature\n"
|
||||
" # to_max: Maximum object temperature\n"
|
||||
" ta, ir, to_min, to_max = fir.read_ir()\n"
|
||||
"\n"
|
||||
" fir.draw_ir(fir_img, ir, color_palette=None)\n"
|
||||
" fir_img_size = fir_img.width() * fir_img.height()\n"
|
||||
"\n"
|
||||
" # Find IR Blobs\n"
|
||||
" blobs = fir_img.find_blobs(threshold_list,\n"
|
||||
" pixels_threshold=(fir_img_size // 100),\n"
|
||||
" area_threshold=(fir_img_size // 100),\n"
|
||||
" merge=True)\n"
|
||||
"\n"
|
||||
" # Collect stats into a list of tuples\n"
|
||||
" blob_stats = []\n"
|
||||
" for b in blobs:\n"
|
||||
" blob_stats.append((b.rect(), map_g_to_temp(img.get_statistics(thresholds=threshold_list,\n"
|
||||
" roi=b.rect()).mean())))\n"
|
||||
" x_scale = img.width() / fir_img.width()\n"
|
||||
" y_scale = img.height() / fir_img.height()\n"
|
||||
" img.draw_image(fir_img, 0, 0, x_scale=x_scale, y_scale=y_scale,\n"
|
||||
" color_palette=image.PALETTE_IRONBOW,\n"
|
||||
" alpha_palette=alpha_pal,\n"
|
||||
" hint=image.BICUBIC)\n"
|
||||
"\n"
|
||||
" # Draw stuff on the colored image\n"
|
||||
" for b in blobs:\n"
|
||||
" img.draw_rectangle(int(b.rect()[0] * x_scale), int(b.rect()[1] * y_scale),\n"
|
||||
" int(b.rect()[2] * x_scale), int(b.rect()[3] * y_scale))\n"
|
||||
" img.draw_cross(int(b.cx() * x_scale), int(b.cy() * y_scale))\n"
|
||||
" for blob_stat in blob_stats:\n"
|
||||
" img.draw_string(int((blob_stat[0][0] * x_scale) + 4), int((blob_stat[0][1] * y_scale) + 1),\n"
|
||||
" '%.2f C' % blob_stat[1], mono_space=False, scale=2)\n"
|
||||
"\n"
|
||||
" # Draw ambient, min and max temperatures.\n"
|
||||
" img.draw_string(4, 0, 'Lepton Temp: %0.2f C' % ta,\n"
|
||||
" color=(255, 255, 255), mono_space=False, scale=2)\n"
|
||||
" img.draw_string(4, 18, 'Min Temp: %0.2f C' % to_min,\n"
|
||||
" color=(255, 255, 255), mono_space=False, scale=2)\n"
|
||||
" img.draw_string(4, 36, 'Max Temp: %0.2f C' % to_max,\n"
|
||||
" color=(255, 255, 255), mono_space=False, scale=2)\n"
|
||||
"\n"
|
||||
" lcd.write(img, hint=(image.BILINEAR | image.CENTER | image.SCALE_ASPECT_KEEP))\n"
|
||||
"\n"
|
||||
;
|
||||
@ -1,14 +0,0 @@
|
||||
static const char fresh_main_py[] =
|
||||
"# main.py -- put your code here!\n"
|
||||
"import machine, time\n"
|
||||
"led = machine.LED(\"LED_BLUE\")\n"
|
||||
"while (True):\n"
|
||||
" led.on()\n"
|
||||
" time.sleep_ms(150)\n"
|
||||
" led.off()\n"
|
||||
" time.sleep_ms(100)\n"
|
||||
" led.on()\n"
|
||||
" time.sleep_ms(150)\n"
|
||||
" led.off()\n"
|
||||
" time.sleep_ms(600)\n"
|
||||
;
|
||||
@ -75,7 +75,7 @@ NORETURN void file_raise_error(FIL *fp, FRESULT res) {
|
||||
if (fp) {
|
||||
f_close(fp);
|
||||
}
|
||||
mp_raise_msg(&mp_type_OSError, (mp_rom_error_text_t) ffs_strerror(res));
|
||||
mp_raise_msg(&mp_type_OSError, (mp_rom_error_text_t) file_strerror(res));
|
||||
}
|
||||
|
||||
static FATFS *lookup_path(const TCHAR **path) {
|
||||
@ -430,4 +430,35 @@ void file_read_check(FIL *fp, const void *data, size_t size) {
|
||||
data = ((uint8_t *) data) + len;
|
||||
}
|
||||
}
|
||||
|
||||
const char *file_strerror(FRESULT res) {
|
||||
static const char *ffs_errors[] = {
|
||||
"Succeeded",
|
||||
"A hard error occurred in the low level disk I/O layer",
|
||||
"Assertion failed",
|
||||
"The physical drive cannot work",
|
||||
"Could not find the file",
|
||||
"Could not find the path",
|
||||
"The path name format is invalid",
|
||||
"Access denied due to prohibited access or directory full",
|
||||
"Access denied due to prohibited access",
|
||||
"The file/directory object is invalid",
|
||||
"The physical drive is write protected",
|
||||
"The logical drive number is invalid",
|
||||
"The volume has no work area",
|
||||
"There is no valid FAT volume",
|
||||
"The f_mkfs() aborted due to any parameter error",
|
||||
"Could not get a grant to access the volume within defined period",
|
||||
"The operation is rejected according to the file sharing policy",
|
||||
"LFN working buffer could not be allocated",
|
||||
"Number of open files > _FS_SHARE",
|
||||
"Given parameter is invalid",
|
||||
};
|
||||
|
||||
if (res > (sizeof(ffs_errors) / sizeof(ffs_errors[0]))) {
|
||||
return "unknown error";
|
||||
} else {
|
||||
return ffs_errors[res];
|
||||
}
|
||||
}
|
||||
#endif //IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
|
||||
@ -28,8 +28,6 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <ff.h>
|
||||
extern const char *ffs_strerror(FRESULT res);
|
||||
|
||||
void file_raise_format(FIL *fp);
|
||||
void file_raise_corrupted(FIL *fp);
|
||||
void file_raise_error(FIL *fp, FRESULT res);
|
||||
@ -66,4 +64,5 @@ void file_write_byte(FIL *fp, uint8_t value);
|
||||
void file_write_short(FIL *fp, uint16_t value);
|
||||
void file_write_long(FIL *fp, uint32_t value);
|
||||
void file_read_check(FIL *fp, const void *data, size_t size);
|
||||
const char *file_strerror(FRESULT res);
|
||||
#endif /* __FILE_UTILS_H__ */
|
||||
|
||||
@ -37,8 +37,8 @@
|
||||
#include "tinyusb_debug.h"
|
||||
#include "omv_common.h"
|
||||
|
||||
#define DEBUG_BAUDRATE_SLOW (921600)
|
||||
#define DEBUG_BAUDRATE_FAST (12000000)
|
||||
#define USBDBG_BAUDRATE_SLOW (921600)
|
||||
#define USBDBG_BAUDRATE_FAST (12000000)
|
||||
#define DEBUG_EP_SIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
|
||||
|
||||
void NORETURN __fatal_error(const char *msg);
|
||||
@ -90,8 +90,8 @@ void tud_cdc_line_coding_cb(uint8_t itf, cdc_line_coding_t const *coding) {
|
||||
} else if (coding->bit_rate == 1200) {
|
||||
MICROPY_BOARD_ENTER_BOOTLOADER(0, 0);
|
||||
#endif
|
||||
} else if (coding->bit_rate == DEBUG_BAUDRATE_SLOW
|
||||
|| coding->bit_rate == DEBUG_BAUDRATE_FAST) {
|
||||
} else if (coding->bit_rate == USBDBG_BAUDRATE_SLOW ||
|
||||
coding->bit_rate == USBDBG_BAUDRATE_FAST) {
|
||||
tinyusb_debug_mode = true;
|
||||
} else {
|
||||
tinyusb_debug_mode = false;
|
||||
|
||||
@ -28,12 +28,14 @@
|
||||
|
||||
/**
|
||||
* Firmware version (major, minor and patch numbers).
|
||||
*
|
||||
*/
|
||||
#define FIRMWARE_VERSION_MAJOR (4)
|
||||
#define FIRMWARE_VERSION_MINOR (6)
|
||||
#define FIRMWARE_VERSION_PATCH (0)
|
||||
|
||||
#define USBDBG_BAUDRATE_SLOW (921600)
|
||||
#define USBDBG_BAUDRATE_FAST (12000000)
|
||||
|
||||
/**
|
||||
* To add a new debugging command, increment the last command value used.
|
||||
* Set the MSB of the value if the request has a device-to-host data phase.
|
||||
|
||||
@ -53,10 +53,6 @@
|
||||
|
||||
const mp_obj_type_t py_image_type;
|
||||
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
extern const char *ffs_strerror(FRESULT res);
|
||||
#endif
|
||||
|
||||
// Haar Cascade ///////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef IMLIB_ENABLE_FEATURES
|
||||
@ -6810,7 +6806,7 @@ mp_obj_t py_image_load_cascade(uint n_args, const mp_obj_t *args, mp_map_t *kw_a
|
||||
if (res != FR_OK) {
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
// cascade is not built-in and failed to load it from file.
|
||||
mp_raise_msg(&mp_type_OSError, (mp_rom_error_text_t) ffs_strerror(res));
|
||||
mp_raise_msg(&mp_type_OSError, (mp_rom_error_text_t) file_strerror(res));
|
||||
#else
|
||||
// cascade is not built-in.
|
||||
mp_raise_msg(&mp_type_OSError, MP_ERROR_TEXT("Image I/O is not supported"));
|
||||
@ -6886,7 +6882,7 @@ mp_obj_t py_image_load_descriptor(uint n_args, const mp_obj_t *args, mp_map_t *k
|
||||
|
||||
// File read error
|
||||
if (res != FR_OK) {
|
||||
mp_raise_msg(&mp_type_OSError, (mp_rom_error_text_t) ffs_strerror(res));
|
||||
mp_raise_msg(&mp_type_OSError, (mp_rom_error_text_t) file_strerror(res));
|
||||
}
|
||||
|
||||
// If no file error and descriptor is still none, then it's not supported.
|
||||
@ -6948,7 +6944,7 @@ mp_obj_t py_image_save_descriptor(uint n_args, const mp_obj_t *args, mp_map_t *k
|
||||
|
||||
// File write error
|
||||
if (res != FR_OK) {
|
||||
mp_raise_msg(&mp_type_OSError, (mp_rom_error_text_t) ffs_strerror(res));
|
||||
mp_raise_msg(&mp_type_OSError, (mp_rom_error_text_t) file_strerror(res));
|
||||
}
|
||||
return mp_const_true;
|
||||
}
|
||||
@ -7049,7 +7045,7 @@ int py_image_descriptor_from_roi(image_t *img, const char *path, rectangle_t *ro
|
||||
file_close(&fp);
|
||||
// File write error
|
||||
if (res != FR_OK) {
|
||||
mp_raise_msg(&mp_type_OSError, (mp_rom_error_text_t) ffs_strerror(res));
|
||||
mp_raise_msg(&mp_type_OSError, (mp_rom_error_text_t) file_strerror(res));
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
} while (0);
|
||||
|
||||
#define MICROPY_ENABLE_VM_ABORT (1)
|
||||
#define MICROPY_OPT_COMPUTED_GOTO (1)
|
||||
#define MICROPY_GC_SPLIT_HEAP (1)
|
||||
#define CYW43_CHIPSET_FIRMWARE_INCLUDE_FILE "lib/cyw43-driver/firmware/w4343WA1_7_45_98_102_combined.h"
|
||||
#define MICROPY_BANNER_NAME_AND_VERSION "OpenMV " OPENMV_GIT_TAG "; MicroPython " MICROPY_GIT_TAG
|
||||
|
||||
@ -91,6 +91,7 @@ MPY_CFLAGS += -I$(TOP_DIR)/$(MICROPY_DIR)/py/
|
||||
MPY_CFLAGS += -I$(TOP_DIR)/$(MICROPY_DIR)/lib/oofatfs
|
||||
MPY_CFLAGS += -I$(TOP_DIR)/$(MICROPY_DIR)/lib/tinyusb/src
|
||||
MPY_CFLAGS += -I$(TOP_DIR)/$(MICROPY_DIR)/lib/lwip/src/include/
|
||||
MPY_CFLAGS += -I$(TOP_DIR)/$(MICROPY_DIR)/shared/tinyusb
|
||||
MPY_CFLAGS += -I$(TOP_DIR)/$(MICROPY_DIR)/ports/mimxrt/
|
||||
MPY_CFLAGS += -I$(TOP_DIR)/$(MICROPY_DIR)/ports/mimxrt/lwip_inc/
|
||||
MPY_CFLAGS += -I$(TOP_DIR)/$(MICROPY_DIR)/shared/runtime/
|
||||
@ -289,7 +290,7 @@ FIRM_OBJ += $(addprefix $(BUILD)/$(MICROPY_DIR)/,\
|
||||
sdio.o \
|
||||
systick.o \
|
||||
ticks.o \
|
||||
tusb_port.o \
|
||||
usbd.o \
|
||||
)
|
||||
|
||||
FIRM_OBJ += $(addprefix $(BUILD)/$(MICROPY_DIR)/hal/,\
|
||||
@ -328,6 +329,7 @@ FIRM_OBJ += $(addprefix $(BUILD)/$(MICROPY_DIR)/shared/,\
|
||||
readline/readline.o \
|
||||
tinyusb/mp_usbd.o \
|
||||
tinyusb/mp_usbd_cdc.o \
|
||||
tinyusb/mp_usbd_descriptor.o \
|
||||
)
|
||||
|
||||
FIRM_OBJ += $(wildcard $(BUILD)/$(MICROPY_DIR)/lib/mbedtls/library/*.o)
|
||||
|
||||
@ -32,4 +32,7 @@
|
||||
} while (0);
|
||||
|
||||
#define MICROPY_ENABLE_VM_ABORT (1)
|
||||
#define MICROPY_OPT_COMPUTED_GOTO (1)
|
||||
#define MICROPY_SCHEDULER_DEPTH (8)
|
||||
#define MICROPY_SCHEDULER_STATIC_NODES (1)
|
||||
#define MICROPY_BANNER_NAME_AND_VERSION "OpenMV " OPENMV_GIT_TAG "; MicroPython " MICROPY_GIT_TAG
|
||||
|
||||
@ -32,4 +32,5 @@
|
||||
} while (0);
|
||||
|
||||
#define MICROPY_ENABLE_VM_ABORT (1)
|
||||
#define MICROPY_OPT_COMPUTED_GOTO (1)
|
||||
#define MICROPY_BANNER_NAME_AND_VERSION "OpenMV " OPENMV_GIT_TAG "; MicroPython " MICROPY_GIT_TAG
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include STM32_HAL_H
|
||||
|
||||
#include "mpconfig.h"
|
||||
@ -98,19 +99,6 @@ int errno;
|
||||
pyb_thread_t pyb_thread_main;
|
||||
#endif
|
||||
|
||||
void flash_error(int n) {
|
||||
led_state(LED_RED, 0);
|
||||
led_state(LED_GREEN, 0);
|
||||
led_state(LED_BLUE, 0);
|
||||
for (int i = 0; i < n; i++) {
|
||||
led_state(LED_RED, 0);
|
||||
HAL_Delay(100);
|
||||
led_state(LED_RED, 1);
|
||||
HAL_Delay(100);
|
||||
}
|
||||
led_state(LED_RED, 0);
|
||||
}
|
||||
|
||||
void NORETURN __fatal_error(const char *msg) {
|
||||
for (uint i = 0;;) {
|
||||
led_toggle(((i++) & 3));
|
||||
@ -136,9 +124,7 @@ void __attribute__((weak)) __assert_func(const char *file, int line, const char
|
||||
uint32_t __stack_chk_guard = 0xDEADBEEF;
|
||||
|
||||
void NORETURN __stack_chk_fail(void) {
|
||||
while (1) {
|
||||
flash_error(100);
|
||||
}
|
||||
__fatal_error("stack check failed");
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -387,3 +373,35 @@ soft_reset_exit:
|
||||
first_soft_reset = false;
|
||||
goto soft_reset;
|
||||
}
|
||||
|
||||
#if MICROPY_PY_BTREE
|
||||
void *malloc(size_t size) {
|
||||
void *p = gc_alloc(size, false);
|
||||
if (p == NULL) {
|
||||
errno = ENOMEM;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
void free(void *ptr) {
|
||||
gc_free(ptr);
|
||||
}
|
||||
|
||||
void *calloc(size_t nmemb, size_t size) {
|
||||
return malloc(nmemb * size);
|
||||
}
|
||||
|
||||
void *realloc(void *ptr, size_t size) {
|
||||
void *p = gc_realloc(ptr, size, true);
|
||||
if (p == NULL) {
|
||||
errno = ENOMEM;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
#endif
|
||||
|
||||
static mp_obj_t pyb_main(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
// Unused.
|
||||
return mp_const_none;
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_KW(pyb_main_obj, 1, pyb_main);
|
||||
|
||||
@ -347,7 +347,7 @@ static mp_obj_t py_winc_fw_update(mp_obj_t self_in, mp_obj_t path_in) {
|
||||
const char *path = mp_obj_str_get_str(path_in);
|
||||
|
||||
if ((res = file_ll_stat(path, &fno)) != FR_OK) {
|
||||
mp_raise_msg(&mp_type_OSError, (mp_rom_error_text_t) ffs_strerror(res));
|
||||
mp_raise_msg(&mp_type_OSError, (mp_rom_error_text_t) file_strerror(res));
|
||||
}
|
||||
|
||||
// Erase the WINC1500 flash.
|
||||
|
||||
@ -32,7 +32,12 @@
|
||||
} while (0);
|
||||
|
||||
#define MICROPY_ENABLE_VM_ABORT (1)
|
||||
#define MICROPY_OPT_COMPUTED_GOTO (1)
|
||||
#define MICROPY_GC_SPLIT_HEAP (1)
|
||||
#define MICROPY_PY_VFS (1)
|
||||
#define MICROPY_PY_SOCKET_EXTENDED_STATE (1)
|
||||
#define MICROPY_BANNER_NAME_AND_VERSION "OpenMV " OPENMV_GIT_TAG "; MicroPython " MICROPY_GIT_TAG
|
||||
#define MICROPY_BOARD_FATAL_ERROR __fatal_error
|
||||
#define MICROPY_HW_DMA_ENABLE_AUTO_TURN_OFF (0)
|
||||
|
||||
void __fatal_error(const char *);
|
||||
|
||||
@ -92,7 +92,9 @@ MPY_CFLAGS += -I$(TOP_DIR)/$(MICROPY_DIR)/shared/runtime/
|
||||
MPY_CFLAGS += -DMICROPY_PY_SSL=1 \
|
||||
-DMICROPY_SSL_MBEDTLS=1 \
|
||||
-DMICROPY_STREAMS_POSIX_API=1 \
|
||||
-DMICROPY_VFS_FAT=1
|
||||
-DMICROPY_VFS_FAT=1 \
|
||||
-DMICROPY_PY_BTREE=1
|
||||
|
||||
|
||||
MICROPY_ARGS += STM32LIB_CMSIS_DIR=$(TOP_DIR)/$(CMSIS_DIR) \
|
||||
STM32LIB_HAL_DIR=$(TOP_DIR)/$(HAL_DIR) \
|
||||
@ -327,7 +329,6 @@ FIRM_OBJ += $(addprefix $(BUILD)/$(MICROPY_DIR)/,\
|
||||
machine_bitstream.o \
|
||||
pybthread.o \
|
||||
mpthreadport.o \
|
||||
posix_helpers.o \
|
||||
mbedtls/mbedtls_port.o \
|
||||
frozen_content.o \
|
||||
)
|
||||
|
||||
@ -72,7 +72,7 @@ mp_uint_t mp_hal_ticks_ms(void)
|
||||
return HAL_GetTick();
|
||||
}
|
||||
|
||||
void __attribute__((noreturn)) __fatal_error()
|
||||
void __attribute__((noreturn)) __fatal_error(const char *error)
|
||||
{
|
||||
while (1) {
|
||||
}
|
||||
@ -98,13 +98,13 @@ void __attribute__((noreturn)) __stack_chk_fail(void)
|
||||
void *xrealloc(void *mem, uint32_t size)
|
||||
{
|
||||
// Will never be called.
|
||||
__fatal_error();
|
||||
__fatal_error("");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
NORETURN void fb_alloc_fail()
|
||||
{
|
||||
__fatal_error();
|
||||
__fatal_error("");
|
||||
}
|
||||
|
||||
int puts(const char *s) {
|
||||
@ -118,7 +118,7 @@ int printf(const char *fmt, ...)
|
||||
|
||||
NORETURN void nlr_jump(void *val)
|
||||
{
|
||||
__fatal_error();
|
||||
__fatal_error("");
|
||||
}
|
||||
|
||||
void *mp_obj_new_exception_msg(const void *exc_type, const char *msg)
|
||||
@ -210,7 +210,7 @@ int main()
|
||||
|
||||
#ifdef OMV_SDRAM_SIZE
|
||||
if (!sdram_init()) {
|
||||
__fatal_error();
|
||||
__fatal_error("");
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -220,7 +220,7 @@ int main()
|
||||
|
||||
// Initialize the csi
|
||||
if (omv_csi_init() != 0) {
|
||||
__fatal_error();
|
||||
__fatal_error("");
|
||||
}
|
||||
|
||||
omv_csi_reset();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user