Skip to content

Commit d4225bb

Browse files
committed
bricks: Prepare boilerplate for builtin EV3 apps.
We'll add one app in the next commit to illustrate how more can be added. This commit sets the stage by enabling the necessary code, such as frozen modules.
1 parent a94b019 commit d4225bb

6 files changed

Lines changed: 11 additions & 4 deletions

File tree

bricks/_common/micropython.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ pbio_error_t pbsys_main_program_validate(pbsys_main_program_t *program) {
305305
case PBIO_PYBRICKS_USER_PROGRAM_ID_IMU_CALIBRATION:
306306
return PBIO_SUCCESS;
307307
#endif
308+
#if PBSYS_CONFIG_FEATURE_BUILTIN_USER_PROGRAM_EV3_APPS
309+
#endif
308310
default:
309311
return PBIO_ERROR_NOT_SUPPORTED;
310312
}
@@ -395,6 +397,9 @@ void pbsys_main_run_program(pbsys_main_program_t *program) {
395397
break;
396398
#endif
397399

400+
#if PBSYS_CONFIG_FEATURE_BUILTIN_USER_PROGRAM_EV3_APPS
401+
#endif
402+
398403
default:
399404
// Init Pybricks package without auto-import.
400405
pb_package_pybricks_init(false);

bricks/ev3/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PBIO_PLATFORM = ev3
22
PB_MCU_FAMILY = TIAM1808
3-
3+
PB_FROZEN_MODULES = 1
44
PB_LIB_UMM_MALLOC = 1
55
PB_LIB_BTSTACK = 1
66
PB_MEDIA = 1

lib/pbio/platform/ev3/pbsysconfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#define PBSYS_CONFIG_FEATURE_BUILTIN_USER_PROGRAM_REPL (1)
55
#define PBSYS_CONFIG_FEATURE_BUILTIN_USER_PROGRAM_PORT_VIEW (0)
66
#define PBSYS_CONFIG_FEATURE_BUILTIN_USER_PROGRAM_IMU_CALIBRATION (0)
7+
#define PBSYS_CONFIG_FEATURE_BUILTIN_USER_PROGRAM_EV3_APPS (1)
78
#define PBSYS_CONFIG_FEATURE_PROGRAM_FORMAT_MULTI_MPY_V6 (1)
89
#define PBSYS_CONFIG_FEATURE_PROGRAM_FORMAT_MULTI_MPY_V6_3_NATIVE (0)
910
#define PBSYS_CONFIG_BATTERY (1)

lib/pbio/platform/virtual_hub/pbsysconfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#define PBSYS_CONFIG_FEATURE_BUILTIN_USER_PROGRAM_REPL (1)
55
#define PBSYS_CONFIG_FEATURE_BUILTIN_USER_PROGRAM_PORT_VIEW (1)
66
#define PBSYS_CONFIG_FEATURE_BUILTIN_USER_PROGRAM_IMU_CALIBRATION (0)
7+
#define PBSYS_CONFIG_FEATURE_BUILTIN_USER_PROGRAM_EV3_APPS (1)
78
#define PBSYS_CONFIG_FEATURE_PROGRAM_FORMAT_MULTI_MPY_V6 (1)
89
#define PBSYS_CONFIG_FEATURE_PROGRAM_FORMAT_MULTI_MPY_V6_3_NATIVE (0)
910

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The image files in this directory come from the official EV3 Source Code
2+
released publicly by LEGO System A/S.

lib/pbio/sys/hmi_ev3_ui.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ static pbsys_hmi_ev3_ui_t state;
8484
* Available apps on app tab.
8585
*/
8686
static const char *apps[] = {
87-
" Motor Control",
88-
" IR Control",
8987
};
9088

9189
/**
@@ -280,7 +278,7 @@ pbsys_hmi_ev3_ui_action_t pbsys_hmi_ev3_ui_handle_button(pbio_button_flags_t but
280278
*payload = state.selection[PBSYS_HMI_EV3_UI_TAB_PROGRAMS];
281279
return PBSYS_HMI_EV3_UI_ACTION_RUN_PROGRAM;
282280
} else if (state.tab == PBSYS_HMI_EV3_UI_TAB_APPS) {
283-
// Apps not yet implemented.
281+
// Other apps not yet implemented.
284282
state.overlay = PBSYS_HMI_EV3_UI_OVERLAY_COMING_SOON;
285283
return PBSYS_HMI_EV3_UI_ACTION_NONE;
286284
} else {

0 commit comments

Comments
 (0)