mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-02-06 11:56:58 +08:00
AP_Networking: disable assert messages for production builds
The string description for the asserts was costing us a lot of flash for not a lot of gain. By not displaying those strings in production builds we save about 11k
This commit is contained in:
committed by
Thomas Watson
parent
b048354907
commit
ec806af44f
@@ -470,10 +470,17 @@ const char *AP_Networking::address_to_str(uint32_t addr)
|
||||
}
|
||||
|
||||
#ifdef LWIP_PLATFORM_ASSERT
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL || defined(HAL_DEBUG_BUILD)
|
||||
void ap_networking_platform_assert(const char *msg, int line)
|
||||
{
|
||||
AP_HAL::panic("LWIP: %s: %u", msg, line);
|
||||
AP_HAL::panic("LWIP:%u %s", line, msg);
|
||||
}
|
||||
#else
|
||||
void ap_networking_platform_assert(int line)
|
||||
{
|
||||
AP_HAL::panic("LWIP:%u", line);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef LWIP_HOOK_IP4_ROUTE
|
||||
|
||||
@@ -400,8 +400,13 @@ void sys_check_core_locking(void);
|
||||
|
||||
#ifndef LWIP_PLATFORM_ASSERT
|
||||
/* Define LWIP_PLATFORM_ASSERT to something to catch missing stdio.h includes */
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL || defined(HAL_DEBUG_BUILD)
|
||||
void ap_networking_platform_assert(const char *msg, int line);
|
||||
#define LWIP_PLATFORM_ASSERT(x) ap_networking_platform_assert(x, __LINE__)
|
||||
#else
|
||||
void ap_networking_platform_assert(int line);
|
||||
#define LWIP_PLATFORM_ASSERT(x) ap_networking_platform_assert(__LINE__)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user