mirror of
https://github.com/flipperdevices/flipperzero-firmware.git
synced 2025-12-12 04:41:26 +04:00
Code Cleanup: unused includes, useless checks, unused variables, etc... (#3696)
* Remove unnecessary checks * Sublime: never insert missing headers * Cleanup furi defines use * Cleanup startup. Cleanup linker scripts. Explicitly define all interrupts hadlers, including uninmplemented one. * Startup routine in C * Drop assembler startup * Move linker defines to stm32wb55_linker.h, cleanup naming, unify usage. Mpu: protect last 32b of main stack. Document various obscure things. * Move furi_hal_switch documentation to appropriate place, use 0x0 for updater jump. * UnitTests: move all temporary test files into tmp folder --------- Co-authored-by: SG <who.just.the.doctor@gmail.com>
This commit is contained in:
@@ -67,6 +67,14 @@ void __furi_critical_exit(__FuriCriticalInfo info);
|
||||
#define FURI_CHECK_RETURN __attribute__((__warn_unused_result__))
|
||||
#endif
|
||||
|
||||
#ifndef FURI_NAKED
|
||||
#define FURI_NAKED __attribute__((naked))
|
||||
#endif
|
||||
|
||||
#ifndef FURI_DEFAULT
|
||||
#define FURI_DEFAULT(x) __attribute__((weak, alias(x)))
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stm32wbxx.h>
|
||||
#include <stm32wb55_linker.h>
|
||||
#include <core/log.h>
|
||||
#include <core/common_defines.h>
|
||||
|
||||
@@ -63,8 +64,6 @@ task.h is included from an application file. */
|
||||
#define heapBITS_PER_BYTE ((size_t)8)
|
||||
|
||||
/* Heap start end symbols provided by linker */
|
||||
extern const void __heap_start__;
|
||||
extern const void __heap_end__;
|
||||
uint8_t* ucHeap = (uint8_t*)&__heap_start__;
|
||||
|
||||
/* Define the linked list structure. This is used to link free blocks in order
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "core/base.h"
|
||||
#include "base.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -20,7 +20,6 @@ FuriPubSub* furi_pubsub_alloc(void) {
|
||||
FuriPubSub* pubsub = malloc(sizeof(FuriPubSub));
|
||||
|
||||
pubsub->mutex = furi_mutex_alloc(FuriMutexTypeNormal);
|
||||
furi_assert(pubsub->mutex);
|
||||
|
||||
FuriPubSubSubscriptionList_init(pubsub->items);
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ static void furi_record_erase(const char* name, FuriRecordData* record_data) {
|
||||
void furi_record_init(void) {
|
||||
furi_record = malloc(sizeof(FuriRecord));
|
||||
furi_record->mutex = furi_mutex_alloc(FuriMutexTypeNormal);
|
||||
furi_check(furi_record->mutex);
|
||||
FuriRecordDataDict_init(furi_record->records);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "core/base.h"
|
||||
#include "base.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
Reference in New Issue
Block a user