Skip to content

Commit

Permalink
HAL_ChibiOS: allow for --disable-networking
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge authored and magicrub committed Nov 17, 2023
1 parent d5470ae commit 2ba4bf1
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,18 +965,19 @@ def write_mcu_config(self, f):
f.write('#define STM32_USB_USE_OTG2 TRUE\n')

if 'ETH1' in self.bytype:
f.write('// Configure for Ethernet support\n')
f.write('#define CH_CFG_USE_MAILBOXES TRUE\n')
f.write('#define HAL_USE_MAC TRUE\n')
f.write('#define MAC_USE_EVENTS TRUE\n')
f.write('#define STM32_ETH_BUFFERS_EXTERN\n')
f.write('#define AP_NETWORKING_ENABLED TRUE\n')
self.build_flags.append('USE_LWIP=yes')
self.env_vars['WITH_NETWORKING'] = True
else:
f.write('#define AP_NETWORKING_ENABLED FALSE\n')
self.build_flags.append('USE_LWIP=no')
self.env_vars['WITH_NETWORKING'] = False
f.write('''
#ifndef AP_NETWORKING_ENABLED
// Configure for Ethernet support
#define AP_NETWORKING_ENABLED 1
#define CH_CFG_USE_MAILBOXES TRUE
#define HAL_USE_MAC TRUE
#define MAC_USE_EVENTS TRUE
#define STM32_ETH_BUFFERS_EXTERN
#endif
''')

defines = self.get_mcu_config('DEFINES', False)
if defines is not None:
Expand Down

0 comments on commit 2ba4bf1

Please sign in to comment.