Get platform-specific preprocessor defines for a board. Args: board_name: Name of the board Returns: PlatformDefinesResult with ok, defines, and error fields
(self, board_name: str)
| 183 | return None |
| 184 | |
| 185 | def get_platform_defines(self, board_name: str) -> PlatformDefinesResult: |
| 186 | """ |
| 187 | Get platform-specific preprocessor defines for a board. |
| 188 | |
| 189 | Args: |
| 190 | board_name: Name of the board |
| 191 | |
| 192 | Returns: |
| 193 | PlatformDefinesResult with ok, defines, and error fields |
| 194 | """ |
| 195 | data = self.load_build_info(board_name) |
| 196 | if not data: |
| 197 | return PlatformDefinesResult( |
| 198 | ok=False, defines=[], error=f"Build info not found for {board_name}" |
| 199 | ) |
| 200 | |
| 201 | board_key = self.create_board_key_from_build_info(data, board_name) |
| 202 | if not board_key: |
| 203 | available_keys = list(data.keys()) |
| 204 | return PlatformDefinesResult( |
| 205 | ok=False, |
| 206 | defines=[], |
| 207 | error=f"Board key not found. Available keys: {available_keys}", |
| 208 | ) |
| 209 | |
| 210 | board_data = data[board_key] |
| 211 | defines = board_data.get("defines", []) |
| 212 | |
| 213 | return PlatformDefinesResult(ok=True, defines=defines, error="") |
| 214 | |
| 215 | def get_compiler_info(self, board_name: str) -> CompilerInfoResult: |
| 216 | """ |
no test coverage detected