LVGL and Classic UI for STM32 (#20552)
This commit is contained in:
		
							
								
								
									
										14
									
								
								buildroot/share/PlatformIO/scripts/anet_et4_openblt.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								buildroot/share/PlatformIO/scripts/anet_et4_openblt.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| # Generate the firmware as OpenBLT needs | ||||
|  | ||||
| import os,sys | ||||
| from os.path import join | ||||
|  | ||||
| Import("env") | ||||
|  | ||||
| env.AddPostAction( | ||||
|     "$BUILD_DIR/${PROGNAME}.elf", | ||||
|     env.VerboseAction(" ".join([ | ||||
|         "$OBJCOPY", "-O", "srec", | ||||
|         "\"$BUILD_DIR/${PROGNAME}.elf\"", "\"$BUILD_DIR/${PROGNAME}.srec\"" | ||||
|     ]), "Building " + join("$BUILD_DIR","${PROGNAME}.srec")) | ||||
| ) | ||||
| @@ -6,9 +6,7 @@ board = DefaultEnvironment().BoardConfig() | ||||
|  | ||||
| def noencrypt(source, target, env): | ||||
|   firmware = os.path.join(target[0].dir.path, board.get("build.firmware")) | ||||
|   # do not overwrite encrypted firmware if present | ||||
|   if not os.path.isfile(firmware): | ||||
|     shutil.copy(target[0].path, firmware) | ||||
|   shutil.copy(target[0].path, firmware) | ||||
|  | ||||
| if 'offset' in board.get("build").keys(): | ||||
|   LD_FLASH_OFFSET = board.get("build.offset") | ||||
| @@ -26,5 +24,7 @@ if 'offset' in board.get("build").keys(): | ||||
|     if "-Wl,--defsym=LD_MAX_DATA_SIZE" in flag: | ||||
|       env["LINKFLAGS"][i] = "-Wl,--defsym=LD_MAX_DATA_SIZE=" + str(maximum_ram_size - 40) | ||||
|  | ||||
|   if 'firmware' in board.get("build").keys(): | ||||
|     env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", noencrypt); | ||||
| board_keys = board.get("build").keys() | ||||
| # Only copy file if there's no encryptation | ||||
| if 'firmware' in board_keys and not 'encrypt' in board_keys: | ||||
|   env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", noencrypt) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user