-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from badgeteam/renze/troopers2023
Troopers 2023: initial support
- Loading branch information
Showing
36 changed files
with
4,419 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
if(CONFIG_DRIVER_LAUNCHER_ENABLE) | ||
set(srcs | ||
"modlauncher.c" | ||
) | ||
else() | ||
set(srcs "") | ||
endif() | ||
|
||
set(include | ||
"include" | ||
) | ||
|
||
idf_component_register( | ||
SRCS "${srcs}" | ||
INCLUDE_DIRS "${include}" | ||
REQUIRES micropython | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
menu "Driver: Badge.team launcher" | ||
config DRIVER_BADGEAPI_ENABLE | ||
bool "Enable the Badge.team launcher driver" | ||
default n | ||
endmenu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#ifndef NO_QSTR | ||
#include "py/mperrno.h" | ||
#include "py/mphal.h" | ||
#include "py/runtime.h" | ||
#include <driver/uart.h> | ||
|
||
#include <esp_system.h> | ||
#include "soc/rtc.h" | ||
#include "soc/rtc_cntl_reg.h" | ||
#endif | ||
|
||
#define TAG "LAUNCHER_UPY" | ||
|
||
void driver_launcher_init() { | ||
|
||
} | ||
|
||
static mp_obj_t driver_launcher_return_to_launcher() { | ||
REG_WRITE(RTC_CNTL_STORE0_REG, 0); | ||
esp_restart(); | ||
return mp_const_none; | ||
} | ||
|
||
static MP_DEFINE_CONST_FUN_OBJ_0(launcher_return_to_launcher_obj, driver_launcher_return_to_launcher); | ||
|
||
STATIC const mp_rom_map_elem_t launcher_module_globals_table[] = { | ||
{MP_ROM_QSTR(MP_QSTR_exit_python), MP_ROM_PTR(&launcher_return_to_launcher_obj)}, | ||
}; | ||
|
||
STATIC MP_DEFINE_CONST_DICT(launcher_module_globals, launcher_module_globals_table); | ||
|
||
//=================================== | ||
const mp_obj_module_t launcher_module = { | ||
.base = {&mp_type_module}, | ||
.globals = (mp_obj_dict_t *)&launcher_module_globals, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#Include all files that contain MP bindings | ||
set(mods | ||
"${COMPONENT_DIR}/modlauncher.c" | ||
) | ||
|
||
#Define the name of your module here | ||
set(mod_name "launcher") | ||
set(mod_register "launcher") | ||
|
||
if(CONFIG_DRIVER_LAUNCHER_ENABLE) | ||
message(STATUS "Launcher API enabled") | ||
set(EXTMODS "${EXTMODS}" "${mods}" CACHE INTERNAL "") | ||
set(EXTMODS_NAMES "${EXTMODS_NAMES}" "${mod_name}" CACHE INTERNAL "") | ||
set(EXTMODS_INIT "${EXTMODS_INIT}" "\"${mod_name}\"@\"${mod_register}\"^" CACHE INTERNAL "") | ||
else() | ||
message(STATUS "Launcher API disabled") | ||
endif() |
Oops, something went wrong.