You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
Remove useless hello_world.c
This commit is contained in:
@@ -9,7 +9,6 @@ UNAME_S := $(shell uname -s)
|
||||
ifneq ($(UNAME_S),Darwin)
|
||||
# Non-macOS settings (e.g., Linux)
|
||||
LDFLAGS += -lv4l2
|
||||
SRC_USERMOD_C += $(MOD_DIR)/src/hello_world.c
|
||||
SRC_USERMOD_C += $(MOD_DIR)/src/webcam.c
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#include "py/obj.h"
|
||||
#include "py/runtime.h"
|
||||
|
||||
|
||||
//#error "building hello world from lcd_utils"
|
||||
|
||||
// C function to print "Hello World"
|
||||
static mp_obj_t hello_world(void) {
|
||||
printf("Hello World from C compiled!\n");
|
||||
return mp_const_none; // MicroPython functions typically return None
|
||||
}
|
||||
|
||||
// Define the function entry in the module
|
||||
static MP_DEFINE_CONST_FUN_OBJ_0(hello_world_obj, hello_world);
|
||||
|
||||
// Module function table
|
||||
static const mp_rom_map_elem_t hello_world_module_globals_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_hello_world) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_hello), MP_ROM_PTR(&hello_world_obj) },
|
||||
};
|
||||
|
||||
// Module globals dictionary
|
||||
static MP_DEFINE_CONST_DICT(hello_world_module_globals, hello_world_module_globals_table);
|
||||
|
||||
// Module definition
|
||||
const mp_obj_module_t hello_world_module = {
|
||||
.base = { &mp_type_module },
|
||||
.globals = (mp_obj_dict_t *)&hello_world_module_globals,
|
||||
};
|
||||
|
||||
// Register the module with MicroPython
|
||||
MP_REGISTER_MODULE(MP_QSTR_hello_world, hello_world_module);
|
||||
Reference in New Issue
Block a user