[FL-2733] multitarget support for fbt (#2209)
* First part of multitarget porting * Delete firmware/targets/f7/Inc directory * Delete firmware/targets/f7/Src directory * gpio: cli fixes; about: using version from HAL * sdk: path fixes * gui: include fixes * applications: more include fixes * gpio: ported to new apis * hal: introduced furi_hal_target_hw.h; libs: added one_wire * hal: f18 target * github: also build f18 by default * typo fix * fbt: removed extra checks on app list * api: explicitly bundling select mlib headers with sdk * hal: f18: changed INPUT_DEBOUNCE_TICKS to match f7 * cleaned up commented out code * docs: added info on hw targets * docs: targets: formatting fixes * f18: fixed link error * f18: fixed API version to match f7 * docs: hardware: minor wording fixes * faploader: added fw target check * docs: typo fixes * github: not building komi target by default * fbt: support for `targets` field for built-in apps * github: reworked build flow to exclude app_set; fbt: removed komi-specific appset; added additional target buildset check * github: fixed build; nfc: fixed pvs warnings * attempt to fix target id * f7, f18: removed certain HAL function from public API * apps: debug: enabled bt_debug_app for f18 * Targets: backport input pins configuration routine from F7 to F18 Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -8,7 +8,6 @@ env.Append(
|
||||
Dir("flipper_format"),
|
||||
Dir("infrared"),
|
||||
Dir("nfc"),
|
||||
Dir("one_wire"),
|
||||
Dir("ST25RFAL002"),
|
||||
Dir("subghz"),
|
||||
Dir("toolbox"),
|
||||
@@ -16,16 +15,9 @@ env.Append(
|
||||
Dir("update_util"),
|
||||
Dir("print"),
|
||||
],
|
||||
SDK_HEADERS=[
|
||||
File("one_wire/one_wire_host_timing.h"),
|
||||
File("one_wire/one_wire_host.h"),
|
||||
File("one_wire/one_wire_slave.h"),
|
||||
File("one_wire/one_wire_device.h"),
|
||||
File("one_wire/ibutton/ibutton_worker.h"),
|
||||
File("one_wire/maxim_crc.h"),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
env.Append(
|
||||
CPPPATH=[
|
||||
"#/",
|
||||
@@ -34,6 +26,23 @@ env.Append(
|
||||
# Ugly hack
|
||||
Dir("../assets/compiled"),
|
||||
],
|
||||
SDK_HEADERS=[
|
||||
*(
|
||||
File(f"#/lib/mlib/m-{name}.h")
|
||||
for name in (
|
||||
"algo",
|
||||
"array",
|
||||
"bptree",
|
||||
"core",
|
||||
"deque",
|
||||
"dict",
|
||||
"list",
|
||||
"rbtree",
|
||||
"tuple",
|
||||
"variant",
|
||||
)
|
||||
),
|
||||
],
|
||||
CPPDEFINES=[
|
||||
'"M_MEMORY_FULL(x)=abort()"',
|
||||
],
|
||||
@@ -47,13 +56,13 @@ env.Append(
|
||||
# littlefs
|
||||
# subghz
|
||||
# toolbox
|
||||
# one_wire
|
||||
# micro-ecc
|
||||
# misc
|
||||
# digital_signal
|
||||
# fnv1a-hash
|
||||
# micro-ecc
|
||||
# fnv1a_hash
|
||||
# microtar
|
||||
# nfc
|
||||
# one_wire
|
||||
# qrcode
|
||||
# u8g2
|
||||
# update_util
|
||||
@@ -77,6 +86,7 @@ libs = env.BuildModules(
|
||||
"drivers",
|
||||
"fatfs",
|
||||
"flipper_format",
|
||||
"one_wire",
|
||||
"infrared",
|
||||
"littlefs",
|
||||
"mbedtls",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "popup_vm.h"
|
||||
#include "gui/modules/popup.h"
|
||||
#include <gui/modules/popup.h>
|
||||
|
||||
PopupVM::PopupVM() {
|
||||
popup = popup_alloc();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "application_manifest.h"
|
||||
|
||||
#include <furi_hal_version.h>
|
||||
|
||||
bool flipper_application_manifest_is_valid(const FlipperApplicationManifest* manifest) {
|
||||
if((manifest->base.manifest_magic != FAP_MANIFEST_MAGIC) ||
|
||||
(manifest->base.manifest_version != FAP_MANIFEST_SUPPORTED_VERSION)) {
|
||||
@@ -19,3 +21,8 @@ bool flipper_application_manifest_is_compatible(
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool flipper_application_manifest_is_target_compatible(const FlipperApplicationManifest* manifest) {
|
||||
const Version* version = furi_hal_version_get_firmware_version();
|
||||
return version_get_target(version) == manifest->base.hardware_target_id;
|
||||
}
|
||||
@@ -65,6 +65,14 @@ bool flipper_application_manifest_is_compatible(
|
||||
const FlipperApplicationManifest* manifest,
|
||||
const ElfApiInterface* api_interface);
|
||||
|
||||
/**
|
||||
* @brief Check if application is compatible with current hardware
|
||||
*
|
||||
* @param manifest
|
||||
* @return bool
|
||||
*/
|
||||
bool flipper_application_manifest_is_target_compatible(const FlipperApplicationManifest* manifest);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -43,6 +43,10 @@ static FlipperApplicationPreloadStatus
|
||||
return FlipperApplicationPreloadStatusInvalidManifest;
|
||||
}
|
||||
|
||||
if(!flipper_application_manifest_is_target_compatible(&app->manifest)) {
|
||||
return FlipperApplicationPreloadStatusTargetMismatch;
|
||||
}
|
||||
|
||||
if(!flipper_application_manifest_is_compatible(
|
||||
&app->manifest, elf_file_get_api_interface(app->elf))) {
|
||||
return FlipperApplicationPreloadStatusApiMismatch;
|
||||
|
||||
@@ -26,7 +26,6 @@ sources = []
|
||||
libs_recurse = [
|
||||
"digital_signal",
|
||||
"micro-ecc",
|
||||
"one_wire",
|
||||
"u8g2",
|
||||
"update_util",
|
||||
]
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <gui/modules/widget.h>
|
||||
#include <nfc_worker_i.h>
|
||||
|
||||
#include "furi_hal.h"
|
||||
#include <furi_hal.h>
|
||||
|
||||
#define ALL_IN_ONE_LAYOUT_UNKNOWN 0
|
||||
#define ALL_IN_ONE_LAYOUT_A 1
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <gui/modules/widget.h>
|
||||
#include <nfc_worker_i.h>
|
||||
|
||||
#include "furi_hal.h"
|
||||
#include <furi_hal.h>
|
||||
|
||||
static const MfClassicAuthContext plantain_keys_4k[] = {
|
||||
{.sector = 0, .key_a = 0xFFFFFFFFFFFF, .key_b = 0xFFFFFFFFFFFF},
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <gui/modules/widget.h>
|
||||
#include <nfc_worker_i.h>
|
||||
|
||||
#include "furi_hal.h"
|
||||
#include <furi_hal.h>
|
||||
|
||||
static const MfClassicAuthContext plantain_keys[] = {
|
||||
{.sector = 0, .key_a = 0xffffffffffff, .key_b = 0xffffffffffff},
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <gui/modules/widget.h>
|
||||
#include <nfc_worker_i.h>
|
||||
|
||||
#include "furi_hal.h"
|
||||
#include <furi_hal.h>
|
||||
|
||||
static const MfClassicAuthContext two_cities_keys_4k[] = {
|
||||
{.sector = 0, .key_a = 0xffffffffffff, .key_b = 0xffffffffffff},
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "mifare_ultralight.h"
|
||||
#include "nfc_util.h"
|
||||
#include <furi.h>
|
||||
#include "furi_hal_nfc.h"
|
||||
#include <furi_hal_nfc.h>
|
||||
|
||||
#define TAG "MfUltralight"
|
||||
|
||||
|
||||
27
lib/one_wire/SConscript
Normal file
27
lib/one_wire/SConscript
Normal file
@@ -0,0 +1,27 @@
|
||||
Import("env")
|
||||
|
||||
env.Append(
|
||||
LINT_SOURCES=[
|
||||
Dir("."),
|
||||
],
|
||||
CPPPATH=[
|
||||
"#/lib/one_wire",
|
||||
],
|
||||
SDK_HEADERS=[
|
||||
File("one_wire_host_timing.h"),
|
||||
File("one_wire_host.h"),
|
||||
File("one_wire_slave.h"),
|
||||
File("one_wire_device.h"),
|
||||
File("ibutton/ibutton_worker.h"),
|
||||
File("maxim_crc.h"),
|
||||
],
|
||||
)
|
||||
|
||||
libenv = env.Clone(FW_LIB_NAME="one_wire")
|
||||
libenv.ApplyLibFlags()
|
||||
|
||||
sources = libenv.GlobRecursive("*.c*")
|
||||
|
||||
lib = libenv.StaticLibrary("${FW_LIB_NAME}", sources)
|
||||
libenv.Install("${LIB_DIST_DIR}", lib)
|
||||
Return("lib")
|
||||
@@ -5,8 +5,8 @@
|
||||
#include <stddef.h>
|
||||
|
||||
#include <lib/flipper_format/flipper_format.h>
|
||||
#include "furi.h"
|
||||
#include "furi_hal.h"
|
||||
#include <furi.h>
|
||||
#include <furi_hal.h>
|
||||
#include "../types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "princeton_for_testing.h"
|
||||
|
||||
#include "furi_hal.h"
|
||||
#include <furi_hal.h>
|
||||
#include "../blocks/math.h"
|
||||
|
||||
/*
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <furi.h>
|
||||
#include <m-list.h>
|
||||
#include "furi_hal_subghz_configs.h"
|
||||
#include <furi_hal_subghz_configs.h>
|
||||
|
||||
#define TAG "SubGhzSetting"
|
||||
|
||||
|
||||
@@ -21,8 +21,10 @@ static const char* update_prepare_result_descr[] = {
|
||||
[UpdatePrepareResultStageMissing] = "Missing Stage2 loader",
|
||||
[UpdatePrepareResultStageIntegrityError] = "Corrupted Stage2 loader",
|
||||
[UpdatePrepareResultManifestPointerError] = "Failed to create update pointer file",
|
||||
[UpdatePrepareResultTargetMismatch] = "Hardware target mismatch",
|
||||
[UpdatePrepareResultOutdatedManifestVersion] = "Update package is too old",
|
||||
[UpdatePrepareResultIntFull] = "Need more free space in internal storage",
|
||||
[UpdatePrepareResultUnspecifiedError] = "Unknown error",
|
||||
};
|
||||
|
||||
const char* update_operation_describe_preparation_result(const UpdatePrepareResult value) {
|
||||
@@ -163,8 +165,9 @@ UpdatePrepareResult update_operation_prepare(const char* manifest_file_path) {
|
||||
result = UpdatePrepareResultOutdatedManifestVersion;
|
||||
break;
|
||||
}
|
||||
|
||||
if(furi_hal_version_get_hw_target() != manifest->target) {
|
||||
/* Only compare hardware target if it is set - pre-production devices accept any firmware*/
|
||||
if(furi_hal_version_get_hw_target() &&
|
||||
(furi_hal_version_get_hw_target() != manifest->target)) {
|
||||
result = UpdatePrepareResultTargetMismatch;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user