mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 12:42:30 +04:00
Merge remote-tracking branch 'OFW/dev' into dev
This commit is contained in:
@@ -43,6 +43,7 @@ libs = env.BuildModules(
|
|||||||
"ble_profile",
|
"ble_profile",
|
||||||
"bit_lib",
|
"bit_lib",
|
||||||
"datetime",
|
"datetime",
|
||||||
|
"ieee754_parse_wrap",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
31
lib/ieee754_parse_wrap/SConscript
Normal file
31
lib/ieee754_parse_wrap/SConscript
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
Import("env")
|
||||||
|
|
||||||
|
wrapped_fn_list = [
|
||||||
|
"strtof",
|
||||||
|
"strtod",
|
||||||
|
]
|
||||||
|
|
||||||
|
for wrapped_fn in wrapped_fn_list:
|
||||||
|
env.Append(
|
||||||
|
LINKFLAGS=[
|
||||||
|
"-Wl,--wrap," + wrapped_fn,
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
env.Append(
|
||||||
|
SDK_HEADERS=[
|
||||||
|
File("wrappers.h"),
|
||||||
|
],
|
||||||
|
LINT_SOURCES=[
|
||||||
|
Dir("."),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
libenv = env.Clone(FW_LIB_NAME="ieee754_parse_wrap")
|
||||||
|
libenv.ApplyLibFlags()
|
||||||
|
|
||||||
|
sources = libenv.GlobRecursive("*.c*", ".")
|
||||||
|
|
||||||
|
lib = libenv.StaticLibrary("${FW_LIB_NAME}", sources)
|
||||||
|
libenv.Install("${LIB_DIST_DIR}", lib)
|
||||||
|
Return("lib")
|
||||||
14
lib/ieee754_parse_wrap/wrappers.c
Normal file
14
lib/ieee754_parse_wrap/wrappers.c
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#include "wrappers.h"
|
||||||
|
|
||||||
|
// Based on the disassembly, providing NULL as `locale` is fine.
|
||||||
|
// The default `strtof` and `strtod` provided in the same libc_nano also just
|
||||||
|
// call these functions, but with an actual locale structure which was taking up
|
||||||
|
// lots of .data space (364 bytes).
|
||||||
|
|
||||||
|
float __wrap_strtof(const char* in, char** tail) {
|
||||||
|
return strtof_l(in, tail, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
double __wrap_strtod(const char* in, char** tail) {
|
||||||
|
return strtod_l(in, tail, NULL);
|
||||||
|
}
|
||||||
14
lib/ieee754_parse_wrap/wrappers.h
Normal file
14
lib/ieee754_parse_wrap/wrappers.h
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
float __wrap_strtof(const char* in, char** tail);
|
||||||
|
double __wrap_strtod(const char* in, char** tail);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
entry,status,name,type,params
|
entry,status,name,type,params
|
||||||
Version,+,83.0,,
|
Version,+,82.2,,
|
||||||
Header,+,applications/services/bt/bt_service/bt.h,,
|
Header,+,applications/services/bt/bt_service/bt.h,,
|
||||||
Header,+,applications/services/bt/bt_service/bt_keys_storage.h,,
|
Header,+,applications/services/bt/bt_service/bt_keys_storage.h,,
|
||||||
Header,+,applications/services/cli/cli.h,,
|
Header,+,applications/services/cli/cli.h,,
|
||||||
@@ -57,6 +57,7 @@ Header,+,lib/flipper_application/plugins/plugin_manager.h,,
|
|||||||
Header,+,lib/flipper_format/flipper_format.h,,
|
Header,+,lib/flipper_format/flipper_format.h,,
|
||||||
Header,+,lib/flipper_format/flipper_format_i.h,,
|
Header,+,lib/flipper_format/flipper_format_i.h,,
|
||||||
Header,+,lib/flipper_format/flipper_format_stream.h,,
|
Header,+,lib/flipper_format/flipper_format_stream.h,,
|
||||||
|
Header,+,lib/ieee754_parse_wrap/wrappers.h,,
|
||||||
Header,+,lib/libusb_stm32/inc/hid_usage_button.h,,
|
Header,+,lib/libusb_stm32/inc/hid_usage_button.h,,
|
||||||
Header,+,lib/libusb_stm32/inc/hid_usage_consumer.h,,
|
Header,+,lib/libusb_stm32/inc/hid_usage_consumer.h,,
|
||||||
Header,+,lib/libusb_stm32/inc/hid_usage_desktop.h,,
|
Header,+,lib/libusb_stm32/inc/hid_usage_desktop.h,,
|
||||||
@@ -382,6 +383,8 @@ Function,+,__wrap_putc,int,"int, FILE*"
|
|||||||
Function,+,__wrap_putchar,int,int
|
Function,+,__wrap_putchar,int,int
|
||||||
Function,+,__wrap_puts,int,const char*
|
Function,+,__wrap_puts,int,const char*
|
||||||
Function,+,__wrap_snprintf,int,"char*, size_t, const char*, ..."
|
Function,+,__wrap_snprintf,int,"char*, size_t, const char*, ..."
|
||||||
|
Function,+,__wrap_strtod,double,"const char*, char**"
|
||||||
|
Function,+,__wrap_strtof,float,"const char*, char**"
|
||||||
Function,+,__wrap_ungetc,int,"int, FILE*"
|
Function,+,__wrap_ungetc,int,"int, FILE*"
|
||||||
Function,+,__wrap_vsnprintf,int,"char*, size_t, const char*, va_list"
|
Function,+,__wrap_vsnprintf,int,"char*, size_t, const char*, va_list"
|
||||||
Function,-,_asiprintf_r,int,"_reent*, char**, const char*, ..."
|
Function,-,_asiprintf_r,int,"_reent*, char**, const char*, ..."
|
||||||
|
|||||||
|
@@ -36,7 +36,8 @@
|
|||||||
"flipper18",
|
"flipper18",
|
||||||
"bit_lib",
|
"bit_lib",
|
||||||
"toolbox",
|
"toolbox",
|
||||||
"datetime"
|
"datetime",
|
||||||
|
"ieee754_parse_wrap"
|
||||||
],
|
],
|
||||||
"excluded_sources": [
|
"excluded_sources": [
|
||||||
"furi_hal_infrared.c",
|
"furi_hal_infrared.c",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
entry,status,name,type,params
|
entry,status,name,type,params
|
||||||
Version,+,83.2,,
|
Version,+,82.2,,
|
||||||
Header,+,applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h,,
|
Header,+,applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h,,
|
||||||
Header,+,applications/services/bt/bt_service/bt.h,,
|
Header,+,applications/services/bt/bt_service/bt.h,,
|
||||||
Header,+,applications/services/bt/bt_service/bt_keys_storage.h,,
|
Header,+,applications/services/bt/bt_service/bt_keys_storage.h,,
|
||||||
@@ -62,6 +62,7 @@ Header,+,lib/flipper_format/flipper_format_stream.h,,
|
|||||||
Header,+,lib/ibutton/ibutton_key.h,,
|
Header,+,lib/ibutton/ibutton_key.h,,
|
||||||
Header,+,lib/ibutton/ibutton_protocols.h,,
|
Header,+,lib/ibutton/ibutton_protocols.h,,
|
||||||
Header,+,lib/ibutton/ibutton_worker.h,,
|
Header,+,lib/ibutton/ibutton_worker.h,,
|
||||||
|
Header,+,lib/ieee754_parse_wrap/wrappers.h,,
|
||||||
Header,+,lib/infrared/encoder_decoder/infrared.h,,
|
Header,+,lib/infrared/encoder_decoder/infrared.h,,
|
||||||
Header,+,lib/infrared/worker/infrared_transmit.h,,
|
Header,+,lib/infrared/worker/infrared_transmit.h,,
|
||||||
Header,+,lib/infrared/worker/infrared_worker.h,,
|
Header,+,lib/infrared/worker/infrared_worker.h,,
|
||||||
@@ -467,6 +468,8 @@ Function,+,__wrap_putc,int,"int, FILE*"
|
|||||||
Function,+,__wrap_putchar,int,int
|
Function,+,__wrap_putchar,int,int
|
||||||
Function,+,__wrap_puts,int,const char*
|
Function,+,__wrap_puts,int,const char*
|
||||||
Function,+,__wrap_snprintf,int,"char*, size_t, const char*, ..."
|
Function,+,__wrap_snprintf,int,"char*, size_t, const char*, ..."
|
||||||
|
Function,+,__wrap_strtod,double,"const char*, char**"
|
||||||
|
Function,+,__wrap_strtof,float,"const char*, char**"
|
||||||
Function,+,__wrap_ungetc,int,"int, FILE*"
|
Function,+,__wrap_ungetc,int,"int, FILE*"
|
||||||
Function,+,__wrap_vsnprintf,int,"char*, size_t, const char*, va_list"
|
Function,+,__wrap_vsnprintf,int,"char*, size_t, const char*, va_list"
|
||||||
Function,-,_asiprintf_r,int,"_reent*, char**, const char*, ..."
|
Function,-,_asiprintf_r,int,"_reent*, char**, const char*, ..."
|
||||||
|
|||||||
|
@@ -50,6 +50,7 @@
|
|||||||
"flipper7",
|
"flipper7",
|
||||||
"bit_lib",
|
"bit_lib",
|
||||||
"toolbox",
|
"toolbox",
|
||||||
"datetime"
|
"datetime",
|
||||||
|
"ieee754_parse_wrap"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user