Merge remote-tracking branch 'OFW/dev' into dev

This commit is contained in:
MX 2024-04-02 17:02:56 +03:00
commit 3ccb2956f3
No known key found for this signature in database
GPG key ID: 7CCC66B7DBDD1C83
17 changed files with 63 additions and 51 deletions

View file

@ -230,6 +230,7 @@ firmware_debug = distenv.PhonyTarget(
source=firmware_env["FW_ELF"],
GDBOPTS="${GDBOPTS_BASE}",
GDBREMOTE="${OPENOCD_GDB_PIPE}",
FBT_FAP_DEBUG_ELF_ROOT=firmware_env["FBT_FAP_DEBUG_ELF_ROOT"],
)
distenv.Depends(firmware_debug, firmware_flash)
@ -239,6 +240,7 @@ distenv.PhonyTarget(
source=firmware_env["FW_ELF"],
GDBOPTS="${GDBOPTS_BASE} ${GDBOPTS_BLACKMAGIC}",
GDBREMOTE="${BLACKMAGIC_ADDR}",
FBT_FAP_DEBUG_ELF_ROOT=firmware_env["FBT_FAP_DEBUG_ELF_ROOT"],
)
# Debug alien elf

View file

@ -4,11 +4,11 @@
#include "../minunit.h"
// v2 tests
void test_furi_create_open();
void test_furi_concurrent_access();
void test_furi_pubsub();
void test_furi_create_open(void);
void test_furi_concurrent_access(void);
void test_furi_pubsub(void);
void test_furi_memmgr();
void test_furi_memmgr(void);
static int foo = 0;

View file

@ -8,31 +8,31 @@
#define TAG "UnitTests"
int run_minunit_test_furi();
int run_minunit_test_furi_hal();
int run_minunit_test_furi_hal_crypto();
int run_minunit_test_furi_string();
int run_minunit_test_infrared();
int run_minunit_test_rpc();
int run_minunit_test_manifest();
int run_minunit_test_flipper_format();
int run_minunit_test_flipper_format_string();
int run_minunit_test_stream();
int run_minunit_test_storage();
int run_minunit_test_subghz();
int run_minunit_test_dirwalk();
int run_minunit_test_power();
int run_minunit_test_protocol_dict();
int run_minunit_test_lfrfid_protocols();
int run_minunit_test_nfc();
int run_minunit_test_bit_lib();
int run_minunit_test_datetime();
int run_minunit_test_float_tools();
int run_minunit_test_bt();
int run_minunit_test_dialogs_file_browser_options();
int run_minunit_test_expansion();
int run_minunit_test_furi(void);
int run_minunit_test_furi_hal(void);
int run_minunit_test_furi_hal_crypto(void);
int run_minunit_test_furi_string(void);
int run_minunit_test_infrared(void);
int run_minunit_test_rpc(void);
int run_minunit_test_manifest(void);
int run_minunit_test_flipper_format(void);
int run_minunit_test_flipper_format_string(void);
int run_minunit_test_stream(void);
int run_minunit_test_storage(void);
int run_minunit_test_subghz(void);
int run_minunit_test_dirwalk(void);
int run_minunit_test_power(void);
int run_minunit_test_protocol_dict(void);
int run_minunit_test_lfrfid_protocols(void);
int run_minunit_test_nfc(void);
int run_minunit_test_bit_lib(void);
int run_minunit_test_datetime(void);
int run_minunit_test_float_tools(void);
int run_minunit_test_bt(void);
int run_minunit_test_dialogs_file_browser_options(void);
int run_minunit_test_expansion(void);
typedef int (*UnitTestEntry)();
typedef int (*UnitTestEntry)(void);
typedef struct {
const char* name;

View file

@ -31,7 +31,6 @@ void bad_usb_scene_config_layout_on_enter(void* context) {
BadUsbApp* bad_usb = context;
if(bad_usb_layout_select(bad_usb)) {
bad_usb_script_set_keyboard_layout(bad_usb->bad_usb_script, bad_usb->keyboard_layout);
scene_manager_search_and_switch_to_previous_scene(bad_usb->scene_manager, BadUsbSceneWork);
} else {
scene_manager_previous_scene(bad_usb->scene_manager);

View file

@ -13,11 +13,12 @@
#define INFRARED_TASK_STACK_SIZE (2048UL)
#define INFRARED_SETTINGS_PATH EXT_PATH("infrared/.infrared.settings")
#define INFRARED_SETTINGS_VERSION (0)
#define INFRARED_SETTINGS_VERSION (1)
#define INFRARED_SETTINGS_MAGIC (0x1F)
typedef struct {
uint8_t tx_pin;
FuriHalInfraredTxPin tx_pin;
bool otg_enabled;
} InfraredSettings;
static const NotificationSequence*
@ -488,11 +489,15 @@ static void infrared_load_settings(InfraredApp* infrared) {
}
infrared_set_tx_pin(infrared, settings.tx_pin);
if(settings.tx_pin < FuriHalInfraredTxPinMax) {
infrared_enable_otg(infrared, settings.otg_enabled);
}
}
void infrared_save_settings(InfraredApp* infrared) {
InfraredSettings settings = {
.tx_pin = infrared->app_state.tx_pin,
.otg_enabled = infrared->app_state.is_otg_enabled,
};
if(!saved_struct_save(

View file

@ -247,6 +247,8 @@ static void nfc_scene_read_success_on_enter_mf_ultralight(NfcApp* instance) {
furi_string_cat_printf(
temp_str, "\e#%s\n", nfc_device_get_name(device, NfcDeviceNameTypeFull));
furi_string_replace(temp_str, "Mifare", "MIFARE");
nfc_render_mf_ultralight_info(data, NfcProtocolFormatTypeShort, temp_str);
}

View file

@ -24,9 +24,9 @@ static const uint8_t reset_display_mask = 1 << 5;
static const uint8_t reset_blink_mask = 1 << 6;
static void notification_vibro_on(bool force);
static void notification_vibro_off();
static void notification_vibro_off(void);
static void notification_sound_on(float freq, float volume, bool force);
static void notification_sound_off();
static void notification_sound_off(void);
static uint8_t notification_settings_get_display_brightness(NotificationApp* app, uint8_t value);
static uint8_t notification_settings_get_rgb_led_brightness(NotificationApp* app, uint8_t value);

View file

@ -44,7 +44,7 @@ class ApplicationsCGenerator:
def get_app_ep_forward(self, app: FlipperApplication):
if app.apptype == FlipperAppType.STARTUP:
return f"extern void {app.entry_point}();"
return f"extern void {app.entry_point}(void);"
return f"extern int32_t {app.entry_point}(void* p);"
def get_app_descr(self, app: FlipperApplication):

View file

@ -32,7 +32,7 @@ def atexist_handler():
for bf in GetBuildFailures():
for node in Flatten(bf.node):
if node.exists and "pvs" in node.name and node.name.endswith(".html"):
if node.exists and "pvs" in node.path and node.name.endswith(".html"):
# macOS
if sys.platform == "darwin":
subprocess.run(["open", node.abspath])

View file

@ -4,6 +4,7 @@ Import("ENV")
ENV.AppendUnique(
CFLAGS=[
"-std=gnu2x",
"-Wstrict-prototypes",
],
CXXFLAGS=[
"-std=c++20",

View file

@ -48,6 +48,9 @@ appenv.AppendUnique(
"stdc++",
"supc++",
],
CFLAGS=[
"-Wno-strict-prototypes",
],
)

View file

@ -49,7 +49,7 @@ static BleGlue* ble_glue = NULL;
// static int32_t ble_glue_shci_thread(void* argument);
static void ble_sys_status_not_callback(SHCI_TL_CmdStatus_t status);
static void ble_sys_user_event_callback(void* pPayload);
static void ble_glue_clear_shared_memory();
static void ble_glue_clear_shared_memory(void);
void ble_glue_set_key_storage_changed_callback(
BleGlueKeyStorageChangedCallback callback,

View file

@ -410,7 +410,7 @@ static void gap_advertise_start(GapState new_state) {
uint16_t min_interval;
uint16_t max_interval;
FURI_LOG_I(TAG, "Start: %d", new_state);
FURI_LOG_D(TAG, "Start: %d", new_state);
if(new_state == GapStateAdvFast) {
min_interval = 0x80; // 80 ms
@ -455,7 +455,7 @@ static void gap_advertise_start(GapState new_state) {
}
static void gap_advertise_stop(void) {
FURI_LOG_I(TAG, "Stop");
FURI_LOG_D(TAG, "Stop");
tBleStatus ret;
if(gap->state > GapStateIdle) {
if(gap->state == GapStateConnected) {

View file

@ -15,14 +15,14 @@
(LL_C2_IPCC_IsActiveFlag_CHx(IPCC, channel) && \
LL_C1_IPCC_IsEnabledReceiveChannel(IPCC, channel))
static void (*FreeBufCb)();
static void (*FreeBufCb)(void);
static void HW_IPCC_BLE_EvtHandler();
static void HW_IPCC_BLE_AclDataEvtHandler();
static void HW_IPCC_MM_FreeBufHandler();
static void HW_IPCC_SYS_CmdEvtHandler();
static void HW_IPCC_SYS_EvtHandler();
static void HW_IPCC_TRACES_EvtHandler();
static void HW_IPCC_BLE_EvtHandler(void);
static void HW_IPCC_BLE_AclDataEvtHandler(void);
static void HW_IPCC_MM_FreeBufHandler(void);
static void HW_IPCC_SYS_CmdEvtHandler(void);
static void HW_IPCC_SYS_EvtHandler(void);
static void HW_IPCC_TRACES_EvtHandler(void);
void HW_IPCC_Rx_Handler(void) {
if(HW_IPCC_RX_PENDING(HW_IPCC_SYSTEM_EVENT_CHANNEL)) {
@ -134,7 +134,7 @@ static void HW_IPCC_SYS_EvtHandler(void) {
LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL);
}
void HW_IPCC_MM_SendFreeBuf(void (*cb)()) {
void HW_IPCC_MM_SendFreeBuf(void (*cb)(void)) {
if(LL_C1_IPCC_IsActiveFlag_CHx(IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL)) {
FreeBufCb = cb;
LL_C1_IPCC_EnableTransmitChannel(IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL);

View file

@ -92,8 +92,8 @@ static void furi_hal_infrared_tx_dma_set_polarity(uint8_t buf_num, uint8_t polar
static void furi_hal_infrared_tx_dma_set_buffer(uint8_t buf_num);
static void furi_hal_infrared_tx_fill_buffer_last(uint8_t buf_num);
static uint8_t furi_hal_infrared_get_current_dma_tx_buffer(void);
static void furi_hal_infrared_tx_dma_polarity_isr();
static void furi_hal_infrared_tx_dma_isr();
static void furi_hal_infrared_tx_dma_polarity_isr(void*);
static void furi_hal_infrared_tx_dma_isr(void*);
static void furi_hal_infrared_tim_rx_isr(void* context) {
UNUSED(context);

View file

@ -305,8 +305,8 @@ void DebugMon_Handler(void) {
extern usbd_device udev;
extern void HW_IPCC_Tx_Handler();
extern void HW_IPCC_Rx_Handler();
extern void HW_IPCC_Tx_Handler(void);
extern void HW_IPCC_Rx_Handler(void);
void SysTick_Handler(void) {
furi_hal_os_tick();

View file

@ -51,7 +51,7 @@ void furi_hal_os_timer_callback(void) {
}
#endif
extern void xPortSysTickHandler();
extern void xPortSysTickHandler(void);
static volatile uint32_t furi_hal_os_skew;