File tree Expand file tree Collapse file tree 6 files changed +52
-43
lines changed Expand file tree Collapse file tree 6 files changed +52
-43
lines changed Original file line number Diff line number Diff line change 9696 " ${workspaceFolder}/bricks/ev3rt/build" ,
9797 " ${workspaceFolder}/micropython" ,
9898 " ${workspaceFolder}/lib/ev3rt-lib/sdk/common" ,
99+ " ${workspaceFolder}/lib/ev3rt-lib/sdk/common/ev3api/include" ,
100+ " ${workspaceFolder}/lib/ev3rt-lib/sdk/common/ev3api/src" ,
101+ " ${workspaceFolder}/lib/ev3rt-lib/target/ev3_gcc/pil/include" ,
99102 " ${workspaceFolder}/lib/ev3rt-lib" ,
100103 " ${workspaceFolder}/lib/ev3rt-lib/include" ,
101104 " ${workspaceFolder}/lib/ev3rt-lib/target/ev3_gcc" ,
Original file line number Diff line number Diff line change 1- // SPDX-License-Identifier: MIT
2- // Copyright (c) 2022 The Pybricks Authors
3-
4- #include "ev3api.h"
5- #include "app.h"
6-
7- #include <pbsys/main.h>
8-
9- // For now, this file is the main entry point from EV3RT. Eventually, this
10- // file can be dropped and main_task() can be mapped to main() in pbsys/main.
11- // For now it enters the MicroPython REPL directly for convenient debugging.
12-
13- static char heap [1024 * 256 ];
14-
15- void main_task (intptr_t unused ) {
16-
17- // Show the Pybricks logo on the screen so we know that something is
18- // running. This should be replaced by an appropriate driver in pbio and
19- // called from the system hmi interface in pbsys.
20- memfile_t memfile ;
21- image_t image ;
22- if (ev3_memfile_load ("/pybricks.bmp" , & memfile ) == E_OK &&
23- ev3_image_load (& memfile , & image ) == E_OK ) {
24- ev3_lcd_draw_image (& image , 0 , 0 );
25- }
26-
27- while (true) {
28- pbsys_main_program_t program = {
29- .id = PBIO_PYBRICKS_USER_PROGRAM_ID_REPL ,
30- .code_start = heap ,
31- .code_end = heap ,
32- .user_ram_start = heap ,
33- .user_ram_end = heap + sizeof (heap ),
34- };
35- pbsys_main_run_program (& program );
36- }
37- }
1+ // Unused, but required for EV3RT build system.
2+ // The main Pybricks entry point is in pbio/platform/ev3rt/platform.c
Original file line number Diff line number Diff line change 66#define PBDRV_CONFIG_CLOCK (1)
77#define PBDRV_CONFIG_CLOCK_EV3RT (1)
88
9+ #define PBDRV_CONFIG_BLOCK_DEVICE (1)
10+ #define PBDRV_CONFIG_BLOCK_DEVICE_TEST (1)
11+ #define PBDRV_CONFIG_BLOCK_DEVICE_TEST_SIZE (8 * 1024)
12+ #define PBDRV_CONFIG_BLOCK_DEVICE_TEST_SIZE_USER (512)
13+
914#define PBDRV_CONFIG_HAS_PORT_A (1)
1015#define PBDRV_CONFIG_HAS_PORT_B (1)
1116#define PBDRV_CONFIG_HAS_PORT_C (1)
Original file line number Diff line number Diff line change 1111#define PBSYS_CONFIG_HMI_NUM_SLOTS (0)
1212#define PBSYS_CONFIG_HUB_LIGHT_MATRIX (0)
1313#define PBSYS_CONFIG_MAIN (1)
14- #define PBSYS_CONFIG_STORAGE (0)
14+ #define PBSYS_CONFIG_STORAGE (1)
15+ #define PBSYS_CONFIG_STORAGE_NUM_SLOTS (1)
16+ #define PBSYS_CONFIG_STORAGE_RAM_SIZE (258 * 1024)
17+ #define PBSYS_CONFIG_STORAGE_ROM_SIZE (PBDRV_CONFIG_BLOCK_DEVICE_TEST_SIZE)
18+ #define PBSYS_CONFIG_STORAGE_USER_DATA_SIZE (PBDRV_CONFIG_BLOCK_DEVICE_TEST_SIZE_USER)
1519#define PBSYS_CONFIG_STATUS_LIGHT (0)
1620#define PBSYS_CONFIG_STATUS_LIGHT_BATTERY (0)
1721#define PBSYS_CONFIG_STATUS_LIGHT_BLUETOOTH (0)
18- #define PBSYS_CONFIG_STATUS_LIGHT_STATE_ANIMATIONS (1)
19- #define PBSYS_CONFIG_USER_PROGRAM (0)
22+ #define PBSYS_CONFIG_STATUS_LIGHT_STATE_ANIMATIONS (0)
23+ #define PBSYS_CONFIG_USER_PROGRAM (1)
24+ #define PBSYS_CONFIG_USER_PROGRAM_AUTO_START (1)
2025#define PBSYS_CONFIG_PROGRAM_STOP (1)
Original file line number Diff line number Diff line change 11// SPDX-License-Identifier: MIT
2- // Copyright (c) 2022 The Pybricks Authors
2+ // Copyright (c) 2024 The Pybricks Authors
33
4- // This file is unused, but required for the common make file.
4+ #include "ev3api.h"
5+ #include "app.h"
6+
7+ #include <pbsys/main.h>
8+
9+ /**
10+ * Any device specific initialization that isn't already done by EV3RT can
11+ * be done here. This follows the pattern of the embedded hubs where there is
12+ * a bit more to do.
13+ */
14+ static void SystemInit (void ) {
15+ // Show the Pybricks logo on the screen so we know that something is
16+ // running. This should be replaced by an appropriate driver in pbio and
17+ // called from the system hmi interface in pbsys.
18+ memfile_t memfile ;
19+ image_t image ;
20+ if (ev3_memfile_load ("/pybricks.bmp" , & memfile ) == E_OK &&
21+ ev3_image_load (& memfile , & image ) == E_OK ) {
22+ ev3_lcd_draw_image (& image , 0 , 0 );
23+ }
24+ }
25+
26+ /**
27+ * This is the main user task launched by EV3RT. It initializes the system
28+ * and then runs to the main pbsys function. This is similar to how these two
29+ * subsequent calls are normally made from startup.s on the embedded hubs.
30+ */
31+ void main_task (intptr_t unused ) {
32+ SystemInit ();
33+ extern int main (int argc , char * * argv );
34+ main (0 , NULL );
35+ }
Original file line number Diff line number Diff line change 1111#define PBSYS_CONFIG_STORAGE_NUM_SLOTS (1)
1212#define PBSYS_CONFIG_STORAGE_RAM_SIZE (10 * 1024)
1313#define PBSYS_CONFIG_STORAGE_ROM_SIZE (PBDRV_CONFIG_BLOCK_DEVICE_TEST_SIZE)
14- #define PBSYS_CONFIG_STORAGE_USER_DATA_SIZE (512 )
14+ #define PBSYS_CONFIG_STORAGE_USER_DATA_SIZE (PBDRV_CONFIG_BLOCK_DEVICE_TEST_SIZE_USER )
1515#define PBSYS_CONFIG_STATUS_LIGHT (0)
1616#define PBSYS_CONFIG_STATUS_LIGHT_BATTERY (0)
1717#define PBSYS_CONFIG_STATUS_LIGHT_BLUETOOTH (0)
You can’t perform that action at this time.
0 commit comments