mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-01 10:04:03 +03:00
Merge branch 'dev' into subfuz
This commit is contained in:
commit
251b747b00
@ -36,6 +36,7 @@ steps:
|
|||||||
- mkdir -p sd-card/nfc/assets
|
- mkdir -p sd-card/nfc/assets
|
||||||
- mkdir -p sd-card/infrared/assets
|
- mkdir -p sd-card/infrared/assets
|
||||||
- mkdir -p sd-card/unirf
|
- mkdir -p sd-card/unirf
|
||||||
|
- mkdir -p sd-card/rfidfuzzer
|
||||||
- mkdir -p sd-card/badusb/layouts
|
- mkdir -p sd-card/badusb/layouts
|
||||||
- cp assets/resources/badusb/layouts/* sd-card/badusb/layouts/
|
- cp assets/resources/badusb/layouts/* sd-card/badusb/layouts/
|
||||||
- cp assets/resources/subghz/assets/dangerous_settings sd-card/subghz/assets/dangerous_settings
|
- cp assets/resources/subghz/assets/dangerous_settings sd-card/subghz/assets/dangerous_settings
|
||||||
@ -48,6 +49,7 @@ steps:
|
|||||||
- cp assets/resources/infrared/assets/projectors.ir sd-card/infrared/assets/projectors.ir
|
- cp assets/resources/infrared/assets/projectors.ir sd-card/infrared/assets/projectors.ir
|
||||||
- cp assets/resources/infrared/assets/audio.ir sd-card/infrared/assets/audio.ir
|
- cp assets/resources/infrared/assets/audio.ir sd-card/infrared/assets/audio.ir
|
||||||
- cp assets/resources/unirf/unirf_map_example.txt sd-card/unirf/unirf_map_example.txt
|
- cp assets/resources/unirf/unirf_map_example.txt sd-card/unirf/unirf_map_example.txt
|
||||||
|
- cp assets/resources/rfidfuzzer/example_uids.txt sd-card/rfidfuzzer/example_uids.txt
|
||||||
- cp assets/resources/Manifest sd-card/Manifest
|
- cp assets/resources/Manifest sd-card/Manifest
|
||||||
- zip -r artifacts-default/sd-card-${DRONE_TAG}.zip sd-card
|
- zip -r artifacts-default/sd-card-${DRONE_TAG}.zip sd-card
|
||||||
- rm -rf sd-card
|
- rm -rf sd-card
|
||||||
|
12
CHANGELOG.md
12
CHANGELOG.md
@ -1,13 +1,7 @@
|
|||||||
### New changes
|
### New changes
|
||||||
* [EM4100] RFID Fuzzer / FlipFrid plugin - upgrade (by @Ganapati & some fixes by @xMasterX) (PRs #54 #55)
|
* Set poweroff button timer to 2sec
|
||||||
* Updated universal remote assets (by @Amec0e)
|
* Debug apps (USB Mouse, UART Echo) now included in release build
|
||||||
* Arkanoid, TicTacToe, Barcode generator plugins excluded from releases to save space, you can enable it in `applications\meta` for your builds
|
* OFW: Toolchain update
|
||||||
* Moved Music Player to Games menu
|
|
||||||
* OFW: NFC collect params for mfkey32 attack & Fix iso14443-4 (DESFire) UID emulation
|
|
||||||
* OFW: IR CLI Decode Command
|
|
||||||
* OFW: SubGhz: add protocol Clemsa, fix decoder BETT
|
|
||||||
* OFW: LF RFID - Keri, Gallagher protocols support
|
|
||||||
* OFW: Other small changes
|
|
||||||
|
|
||||||
**Note: To avoid issues prefer installing using web updater or by self update package, all needed assets will be installed**
|
**Note: To avoid issues prefer installing using web updater or by self update package, all needed assets will be installed**
|
||||||
|
|
||||||
|
@ -60,8 +60,8 @@ See changelog in releases for latest updates!
|
|||||||
- ESP8266 Deauther plugin [(by SequoiaSan)](https://github.com/SequoiaSan/FlipperZero-Wifi-ESP8266-Deauther-Module)
|
- ESP8266 Deauther plugin [(by SequoiaSan)](https://github.com/SequoiaSan/FlipperZero-Wifi-ESP8266-Deauther-Module)
|
||||||
- WiFi Scanner plugin [(by SequoiaSan)](https://github.com/SequoiaSan/FlipperZero-WiFi-Scanner_Module)
|
- WiFi Scanner plugin [(by SequoiaSan)](https://github.com/SequoiaSan/FlipperZero-WiFi-Scanner_Module)
|
||||||
- MultiConverter plugin [(by theisolinearchip)](https://github.com/theisolinearchip/flipperzero_stuff)
|
- MultiConverter plugin [(by theisolinearchip)](https://github.com/theisolinearchip/flipperzero_stuff)
|
||||||
- `Excluded from releases` - WAV player plugin (fixed) [(OFW: DrZlo13)](https://github.com/flipperdevices/flipperzero-firmware/tree/zlo/wav-player)
|
- WAV player plugin (fixed) [(OFW: DrZlo13)](https://github.com/flipperdevices/flipperzero-firmware/tree/zlo/wav-player)
|
||||||
- `Excluded from releases` - UPC-A Barcode generator plugin [(by McAzzaMan)](https://github.com/McAzzaMan/flipperzero-firmware/tree/UPC-A_Barcode_Generator/applications/barcode_generator)
|
- UPC-A Barcode generator plugin [(by McAzzaMan)](https://github.com/McAzzaMan/flipperzero-firmware/tree/UPC-A_Barcode_Generator/applications/barcode_generator)
|
||||||
- GPIO: Sentry Safe plugin [(by H4ckd4ddy)](https://github.com/H4ckd4ddy/flipperzero-sentry-safe-plugin)
|
- GPIO: Sentry Safe plugin [(by H4ckd4ddy)](https://github.com/H4ckd4ddy/flipperzero-sentry-safe-plugin)
|
||||||
- ESP32: WiFi Marauder companion plugin [(by 0xchocolate)](https://github.com/0xchocolate/flipperzero-firmware-with-wifi-marauder-companion)
|
- ESP32: WiFi Marauder companion plugin [(by 0xchocolate)](https://github.com/0xchocolate/flipperzero-firmware-with-wifi-marauder-companion)
|
||||||
- NRF24: Sniffer & MouseJacker (with changes) [(by mothball187)](https://github.com/mothball187/flipperzero-nrf24/tree/main/mousejacker)
|
- NRF24: Sniffer & MouseJacker (with changes) [(by mothball187)](https://github.com/mothball187/flipperzero-nrf24/tree/main/mousejacker)
|
||||||
@ -69,8 +69,8 @@ See changelog in releases for latest updates!
|
|||||||
- UniversalRF Remix / Sub-GHz Remote [(by ESurge)](https://github.com/ESurge/flipperzero-firmware-unirfremix)[(updated and all protocol support added by darmiel & xMasterX)](https://github.com/darmiel/flipper-playlist/tree/feat/unirf-protocols)
|
- UniversalRF Remix / Sub-GHz Remote [(by ESurge)](https://github.com/ESurge/flipperzero-firmware-unirfremix)[(updated and all protocol support added by darmiel & xMasterX)](https://github.com/darmiel/flipper-playlist/tree/feat/unirf-protocols)
|
||||||
- Tetris (with fixes) [(by jeffplang)](https://github.com/jeffplang/flipperzero-firmware/tree/tetris_game/applications/tetris_game)
|
- Tetris (with fixes) [(by jeffplang)](https://github.com/jeffplang/flipperzero-firmware/tree/tetris_game/applications/tetris_game)
|
||||||
- Spectrum Analyzer (with changes) [(by jolcese)](https://github.com/jolcese/flipperzero-firmware/tree/spectrum/applications/spectrum_analyzer) - [Ultra Narrow mode & scan channels non-consecutively](https://github.com/theY4Kman/flipperzero-firmware/commits?author=theY4Kman)
|
- Spectrum Analyzer (with changes) [(by jolcese)](https://github.com/jolcese/flipperzero-firmware/tree/spectrum/applications/spectrum_analyzer) - [Ultra Narrow mode & scan channels non-consecutively](https://github.com/theY4Kman/flipperzero-firmware/commits?author=theY4Kman)
|
||||||
- `Excluded from releases` - Arkanoid (with fixes) [(by gotnull)](https://github.com/gotnull/flipperzero-firmware-wPlugins)
|
- Arkanoid (with fixes) [(by gotnull)](https://github.com/gotnull/flipperzero-firmware-wPlugins)
|
||||||
- `Excluded from releases` - Tic Tac Toe (with fixes) [(by gotnull)](https://github.com/gotnull/flipperzero-firmware-wPlugins)
|
- Tic Tac Toe (with fixes) [(by gotnull)](https://github.com/gotnull/flipperzero-firmware-wPlugins)
|
||||||
|
|
||||||
### Other changes
|
### Other changes
|
||||||
|
|
||||||
|
@ -15,6 +15,16 @@ App(
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
App(
|
||||||
|
appid="debug_apps_lite",
|
||||||
|
name="Basic debug apps bundle",
|
||||||
|
apptype=FlipperAppType.METAPACKAGE,
|
||||||
|
provides=[
|
||||||
|
"usb_mouse",
|
||||||
|
"uart_echo",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
App(
|
App(
|
||||||
appid="blink_test",
|
appid="blink_test",
|
||||||
name="Blink Test",
|
name="Blink Test",
|
||||||
|
@ -16,7 +16,7 @@ struct DesktopMainView {
|
|||||||
TimerHandle_t poweroff_timer;
|
TimerHandle_t poweroff_timer;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define DESKTOP_MAIN_VIEW_POWEROFF_TIMEOUT 3000
|
#define DESKTOP_MAIN_VIEW_POWEROFF_TIMEOUT 2000
|
||||||
|
|
||||||
static void desktop_main_poweroff_timer_callback(TimerHandle_t timer) {
|
static void desktop_main_poweroff_timer_callback(TimerHandle_t timer) {
|
||||||
DesktopMainView* main_view = pvTimerGetTimerID(timer);
|
DesktopMainView* main_view = pvTimerGetTimerID(timer);
|
||||||
|
@ -46,8 +46,9 @@ App(
|
|||||||
provides=[
|
provides=[
|
||||||
"snake_game",
|
"snake_game",
|
||||||
"tetris_game",
|
"tetris_game",
|
||||||
#"arkanoid_game",
|
"arkanoid_game",
|
||||||
#"tictactoe_game",
|
"tictactoe_game",
|
||||||
|
"wav_player",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -68,14 +69,13 @@ App(
|
|||||||
apptype=FlipperAppType.METAPACKAGE,
|
apptype=FlipperAppType.METAPACKAGE,
|
||||||
provides=[
|
provides=[
|
||||||
"picopass",
|
"picopass",
|
||||||
#"barcode_generator",
|
"barcode_generator",
|
||||||
"mouse_jacker",
|
"mouse_jacker",
|
||||||
"nrf_sniff",
|
"nrf_sniff",
|
||||||
"sentry_safe",
|
"sentry_safe",
|
||||||
"wifi_marauder",
|
"wifi_marauder",
|
||||||
"esp8266_deauth",
|
"esp8266_deauth",
|
||||||
"wifi_scanner",
|
"wifi_scanner",
|
||||||
#"wav_player",
|
|
||||||
"multi_converter",
|
"multi_converter",
|
||||||
"flipfrid",
|
"flipfrid",
|
||||||
],
|
],
|
||||||
|
@ -10,7 +10,7 @@ App(
|
|||||||
],
|
],
|
||||||
provides=["music_player_start"],
|
provides=["music_player_start"],
|
||||||
stack_size=2 * 1024,
|
stack_size=2 * 1024,
|
||||||
order=40,
|
order=45,
|
||||||
)
|
)
|
||||||
|
|
||||||
App(
|
App(
|
||||||
|
@ -35,13 +35,13 @@ typedef struct {
|
|||||||
|
|
||||||
char rate_text_fmt[] = "Transfer rate: %dMbps";
|
char rate_text_fmt[] = "Transfer rate: %dMbps";
|
||||||
char sample_text_fmt[] = "Sample Time: %d ms";
|
char sample_text_fmt[] = "Sample Time: %d ms";
|
||||||
char channel_text_fmt[] = "Channel: %d";
|
char channel_text_fmt[] = "Channel: %d Sniffing: %s";
|
||||||
char preamble_text_fmt[] = "Preamble: %02X";
|
char preamble_text_fmt[] = "Preamble: %02X";
|
||||||
char sniff_text_fmt[] = "Sniffing: %s Found: %d";
|
char sniff_text_fmt[] = "Found: %d Unique: %u";
|
||||||
char addresses_header_text[] = "Address,rate";
|
char addresses_header_text[] = "Address,rate";
|
||||||
char sniffed_address_fmt[] = "%s,%d";
|
char sniffed_address_fmt[] = "%s,%d";
|
||||||
char rate_text[46];
|
char rate_text[46];
|
||||||
char channel_text[14];
|
char channel_text[38];
|
||||||
char sample_text[32];
|
char sample_text[32];
|
||||||
char preamble_text[14];
|
char preamble_text[14];
|
||||||
char sniff_text[38];
|
char sniff_text[38];
|
||||||
@ -49,6 +49,7 @@ char sniffed_address[14];
|
|||||||
|
|
||||||
uint8_t target_channel = 0;
|
uint8_t target_channel = 0;
|
||||||
uint32_t found_count = 0;
|
uint32_t found_count = 0;
|
||||||
|
uint32_t unique_saved_count = 0;
|
||||||
uint32_t sample_time = DEFAULT_SAMPLE_TIME;
|
uint32_t sample_time = DEFAULT_SAMPLE_TIME;
|
||||||
uint8_t target_rate = 8; // rate can be either 8 (2Mbps) or 0 (1Mbps)
|
uint8_t target_rate = 8; // rate can be either 8 (2Mbps) or 0 (1Mbps)
|
||||||
uint8_t target_preamble[] = {0xAA, 0x00};
|
uint8_t target_preamble[] = {0xAA, 0x00};
|
||||||
@ -111,10 +112,10 @@ static void render_callback(Canvas* const canvas, void* ctx) {
|
|||||||
if(!sniffing_state) strcpy(sniffing, "No");
|
if(!sniffing_state) strcpy(sniffing, "No");
|
||||||
|
|
||||||
snprintf(rate_text, sizeof(rate_text), rate_text_fmt, (int)rate);
|
snprintf(rate_text, sizeof(rate_text), rate_text_fmt, (int)rate);
|
||||||
snprintf(channel_text, sizeof(channel_text), channel_text_fmt, (int)target_channel);
|
snprintf(channel_text, sizeof(channel_text), channel_text_fmt, (int)target_channel, sniffing);
|
||||||
snprintf(sample_text, sizeof(sample_text), sample_text_fmt, (int)sample_time);
|
snprintf(sample_text, sizeof(sample_text), sample_text_fmt, (int)sample_time);
|
||||||
//snprintf(preamble_text, sizeof(preamble_text), preamble_text_fmt, target_preamble[0]);
|
//snprintf(preamble_text, sizeof(preamble_text), preamble_text_fmt, target_preamble[0]);
|
||||||
snprintf(sniff_text, sizeof(sniff_text), sniff_text_fmt, sniffing, found_count);
|
snprintf(sniff_text, sizeof(sniff_text), sniff_text_fmt, found_count, unique_saved_count);
|
||||||
snprintf(
|
snprintf(
|
||||||
sniffed_address, sizeof(sniffed_address), sniffed_address_fmt, top_address, (int)rate);
|
sniffed_address, sizeof(sniffed_address), sniffed_address_fmt, top_address, (int)rate);
|
||||||
canvas_draw_str_aligned(canvas, 10, 10, AlignLeft, AlignBottom, rate_text);
|
canvas_draw_str_aligned(canvas, 10, 10, AlignLeft, AlignBottom, rate_text);
|
||||||
@ -203,6 +204,7 @@ static bool save_addr_to_file(
|
|||||||
notification_message(notification, &sequence_success);
|
notification_message(notification, &sequence_success);
|
||||||
|
|
||||||
stream_free(stream);
|
stream_free(stream);
|
||||||
|
unique_saved_count++;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -287,8 +289,8 @@ static void wrap_up(Storage* storage, NotificationApp* notification) {
|
|||||||
|
|
||||||
if(ch <= LOGITECH_MAX_CHANNEL) {
|
if(ch <= LOGITECH_MAX_CHANNEL) {
|
||||||
hexlify(addr, 5, top_address);
|
hexlify(addr, 5, top_address);
|
||||||
save_addr_to_file(storage, addr, 5, notification);
|
|
||||||
found_count++;
|
found_count++;
|
||||||
|
save_addr_to_file(storage, addr, 5, notification);
|
||||||
if(confirmed_idx < MAX_CONFIRMED) memcpy(confirmed[confirmed_idx++], addr, 5);
|
if(confirmed_idx < MAX_CONFIRMED) memcpy(confirmed[confirmed_idx++], addr, 5);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -297,6 +299,7 @@ static void wrap_up(Storage* storage, NotificationApp* notification) {
|
|||||||
|
|
||||||
static void clear_cache() {
|
static void clear_cache() {
|
||||||
found_count = 0;
|
found_count = 0;
|
||||||
|
unique_saved_count = 0;
|
||||||
confirmed_idx = 0;
|
confirmed_idx = 0;
|
||||||
candidate_idx = 0;
|
candidate_idx = 0;
|
||||||
target_channel = 2;
|
target_channel = 2;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
/* When less than LFS_RESERVED_PAGES_COUNT are left free, creation &
|
/* When less than LFS_RESERVED_PAGES_COUNT are left free, creation &
|
||||||
* modification of non-dot files is restricted */
|
* modification of non-dot files is restricted */
|
||||||
#define LFS_RESERVED_PAGES_COUNT 5
|
#define LFS_RESERVED_PAGES_COUNT 3
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const size_t start_address;
|
const size_t start_address;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
App(
|
App(
|
||||||
appid="wav_player",
|
appid="wav_player",
|
||||||
name="WAV Player",
|
name="WAV Player",
|
||||||
apptype=FlipperAppType.PLUGIN,
|
apptype=FlipperAppType.GAME,
|
||||||
entry_point="wav_player_app",
|
entry_point="wav_player_app",
|
||||||
cdefines=["APP_WAV_PLAYER"],
|
cdefines=["APP_WAV_PLAYER"],
|
||||||
stack_size=4 * 1024,
|
stack_size=4 * 1024,
|
||||||
order=21,
|
order=46,
|
||||||
)
|
)
|
||||||
|
@ -86,7 +86,7 @@ FIRMWARE_APPS = {
|
|||||||
# Custom Games
|
# Custom Games
|
||||||
"custom_games",
|
"custom_games",
|
||||||
# Debug
|
# Debug
|
||||||
"debug_apps",
|
"debug_apps_lite",
|
||||||
],
|
],
|
||||||
"unit_tests": [
|
"unit_tests": [
|
||||||
"basic_services",
|
"basic_services",
|
||||||
|
@ -11,15 +11,20 @@
|
|||||||
|
|
||||||
#define LFS_TAG "Lfs"
|
#define LFS_TAG "Lfs"
|
||||||
|
|
||||||
|
#ifdef FURI_LFS_DEBUG
|
||||||
#define LFS_TRACE(...) FURI_LOG_T(LFS_TAG, __VA_ARGS__);
|
#define LFS_TRACE(...) FURI_LOG_T(LFS_TAG, __VA_ARGS__);
|
||||||
|
|
||||||
#define LFS_DEBUG(...) FURI_LOG_D(LFS_TAG, __VA_ARGS__);
|
#define LFS_DEBUG(...) FURI_LOG_D(LFS_TAG, __VA_ARGS__);
|
||||||
|
#else
|
||||||
|
#define LFS_TRACE(...)
|
||||||
|
|
||||||
|
#define LFS_DEBUG(...)
|
||||||
|
#endif // FURI_LFS_DEBUG
|
||||||
|
|
||||||
#define LFS_WARN(...) FURI_LOG_W(LFS_TAG, __VA_ARGS__);
|
#define LFS_WARN(...) FURI_LOG_W(LFS_TAG, __VA_ARGS__);
|
||||||
|
|
||||||
#define LFS_ERROR(...) FURI_LOG_E(LFS_TAG, __VA_ARGS__);
|
#define LFS_ERROR(...) FURI_LOG_E(LFS_TAG, __VA_ARGS__);
|
||||||
|
|
||||||
|
|
||||||
// Because crc
|
// Because crc
|
||||||
#undef LFS_CONFIG
|
#undef LFS_CONFIG
|
||||||
|
|
||||||
@ -35,16 +40,13 @@
|
|||||||
#ifndef LFS_NO_ASSERT
|
#ifndef LFS_NO_ASSERT
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#endif
|
#endif
|
||||||
#if !defined(LFS_NO_DEBUG) || \
|
#if !defined(LFS_NO_DEBUG) || !defined(LFS_NO_WARN) || !defined(LFS_NO_ERROR) || \
|
||||||
!defined(LFS_NO_WARN) || \
|
|
||||||
!defined(LFS_NO_ERROR) || \
|
|
||||||
defined(LFS_YES_TRACE)
|
defined(LFS_YES_TRACE)
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C" {
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Builtin functions, these may be replaced by more efficient
|
// Builtin functions, these may be replaced by more efficient
|
||||||
@ -66,21 +68,29 @@ static inline uint32_t lfs_aligndown(uint32_t a, uint32_t alignment) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline uint32_t lfs_alignup(uint32_t a, uint32_t alignment) {
|
static inline uint32_t lfs_alignup(uint32_t a, uint32_t alignment) {
|
||||||
return lfs_aligndown(a + alignment-1, alignment);
|
return lfs_aligndown(a + alignment - 1, alignment);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the smallest power of 2 greater than or equal to a
|
// Find the smallest power of 2 greater than or equal to a
|
||||||
static inline uint32_t lfs_npw2(uint32_t a) {
|
static inline uint32_t lfs_npw2(uint32_t a) {
|
||||||
#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM))
|
#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM))
|
||||||
return 32 - __builtin_clz(a-1);
|
return 32 - __builtin_clz(a - 1);
|
||||||
#else
|
#else
|
||||||
uint32_t r = 0;
|
uint32_t r = 0;
|
||||||
uint32_t s;
|
uint32_t s;
|
||||||
a -= 1;
|
a -= 1;
|
||||||
s = (a > 0xffff) << 4; a >>= s; r |= s;
|
s = (a > 0xffff) << 4;
|
||||||
s = (a > 0xff ) << 3; a >>= s; r |= s;
|
a >>= s;
|
||||||
s = (a > 0xf ) << 2; a >>= s; r |= s;
|
r |= s;
|
||||||
s = (a > 0x3 ) << 1; a >>= s; r |= s;
|
s = (a > 0xff) << 3;
|
||||||
|
a >>= s;
|
||||||
|
r |= s;
|
||||||
|
s = (a > 0xf) << 2;
|
||||||
|
a >>= s;
|
||||||
|
r |= s;
|
||||||
|
s = (a > 0x3) << 1;
|
||||||
|
a >>= s;
|
||||||
|
r |= s;
|
||||||
return (r | (a >> 1)) + 1;
|
return (r | (a >> 1)) + 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -114,20 +124,23 @@ static inline int lfs_scmp(uint32_t a, uint32_t b) {
|
|||||||
|
|
||||||
// Convert between 32-bit little-endian and native order
|
// Convert between 32-bit little-endian and native order
|
||||||
static inline uint32_t lfs_fromle32(uint32_t a) {
|
static inline uint32_t lfs_fromle32(uint32_t a) {
|
||||||
#if !defined(LFS_NO_INTRINSICS) && ( \
|
#if !defined(LFS_NO_INTRINSICS) && \
|
||||||
(defined( BYTE_ORDER ) && defined( ORDER_LITTLE_ENDIAN ) && BYTE_ORDER == ORDER_LITTLE_ENDIAN ) || \
|
((defined(BYTE_ORDER) && defined(ORDER_LITTLE_ENDIAN) && \
|
||||||
(defined(__BYTE_ORDER ) && defined(__ORDER_LITTLE_ENDIAN ) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN ) || \
|
BYTE_ORDER == ORDER_LITTLE_ENDIAN) || \
|
||||||
(defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
|
(defined(__BYTE_ORDER) && defined(__ORDER_LITTLE_ENDIAN) && \
|
||||||
|
__BYTE_ORDER == __ORDER_LITTLE_ENDIAN) || \
|
||||||
|
(defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \
|
||||||
|
__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
|
||||||
return a;
|
return a;
|
||||||
#elif !defined(LFS_NO_INTRINSICS) && ( \
|
#elif !defined(LFS_NO_INTRINSICS) && \
|
||||||
(defined( BYTE_ORDER ) && defined( ORDER_BIG_ENDIAN ) && BYTE_ORDER == ORDER_BIG_ENDIAN ) || \
|
((defined(BYTE_ORDER) && defined(ORDER_BIG_ENDIAN) && BYTE_ORDER == ORDER_BIG_ENDIAN) || \
|
||||||
(defined(__BYTE_ORDER ) && defined(__ORDER_BIG_ENDIAN ) && __BYTE_ORDER == __ORDER_BIG_ENDIAN ) || \
|
(defined(__BYTE_ORDER) && defined(__ORDER_BIG_ENDIAN) && \
|
||||||
(defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
|
__BYTE_ORDER == __ORDER_BIG_ENDIAN) || \
|
||||||
|
(defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && \
|
||||||
|
__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
|
||||||
return __builtin_bswap32(a);
|
return __builtin_bswap32(a);
|
||||||
#else
|
#else
|
||||||
return (((uint8_t*)&a)[0] << 0) |
|
return (((uint8_t*)&a)[0] << 0) | (((uint8_t*)&a)[1] << 8) | (((uint8_t*)&a)[2] << 16) |
|
||||||
(((uint8_t*)&a)[1] << 8) |
|
|
||||||
(((uint8_t*)&a)[2] << 16) |
|
|
||||||
(((uint8_t*)&a)[3] << 24);
|
(((uint8_t*)&a)[3] << 24);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -138,20 +151,23 @@ static inline uint32_t lfs_tole32(uint32_t a) {
|
|||||||
|
|
||||||
// Convert between 32-bit big-endian and native order
|
// Convert between 32-bit big-endian and native order
|
||||||
static inline uint32_t lfs_frombe32(uint32_t a) {
|
static inline uint32_t lfs_frombe32(uint32_t a) {
|
||||||
#if !defined(LFS_NO_INTRINSICS) && ( \
|
#if !defined(LFS_NO_INTRINSICS) && \
|
||||||
(defined( BYTE_ORDER ) && defined( ORDER_LITTLE_ENDIAN ) && BYTE_ORDER == ORDER_LITTLE_ENDIAN ) || \
|
((defined(BYTE_ORDER) && defined(ORDER_LITTLE_ENDIAN) && \
|
||||||
(defined(__BYTE_ORDER ) && defined(__ORDER_LITTLE_ENDIAN ) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN ) || \
|
BYTE_ORDER == ORDER_LITTLE_ENDIAN) || \
|
||||||
(defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
|
(defined(__BYTE_ORDER) && defined(__ORDER_LITTLE_ENDIAN) && \
|
||||||
|
__BYTE_ORDER == __ORDER_LITTLE_ENDIAN) || \
|
||||||
|
(defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \
|
||||||
|
__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
|
||||||
return __builtin_bswap32(a);
|
return __builtin_bswap32(a);
|
||||||
#elif !defined(LFS_NO_INTRINSICS) && ( \
|
#elif !defined(LFS_NO_INTRINSICS) && \
|
||||||
(defined( BYTE_ORDER ) && defined( ORDER_BIG_ENDIAN ) && BYTE_ORDER == ORDER_BIG_ENDIAN ) || \
|
((defined(BYTE_ORDER) && defined(ORDER_BIG_ENDIAN) && BYTE_ORDER == ORDER_BIG_ENDIAN) || \
|
||||||
(defined(__BYTE_ORDER ) && defined(__ORDER_BIG_ENDIAN ) && __BYTE_ORDER == __ORDER_BIG_ENDIAN ) || \
|
(defined(__BYTE_ORDER) && defined(__ORDER_BIG_ENDIAN) && \
|
||||||
(defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
|
__BYTE_ORDER == __ORDER_BIG_ENDIAN) || \
|
||||||
|
(defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && \
|
||||||
|
__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
|
||||||
return a;
|
return a;
|
||||||
#else
|
#else
|
||||||
return (((uint8_t*)&a)[0] << 24) |
|
return (((uint8_t*)&a)[0] << 24) | (((uint8_t*)&a)[1] << 16) | (((uint8_t*)&a)[2] << 8) |
|
||||||
(((uint8_t*)&a)[1] << 16) |
|
|
||||||
(((uint8_t*)&a)[2] << 8) |
|
|
||||||
(((uint8_t*)&a)[3] << 0);
|
(((uint8_t*)&a)[3] << 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -161,11 +177,11 @@ static inline uint32_t lfs_tobe32(uint32_t a) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Calculate CRC-32 with polynomial = 0x04c11db7
|
// Calculate CRC-32 with polynomial = 0x04c11db7
|
||||||
uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size);
|
uint32_t lfs_crc(uint32_t crc, const void* buffer, size_t size);
|
||||||
|
|
||||||
// Allocate memory, only used if buffers are not provided to littlefs
|
// Allocate memory, only used if buffers are not provided to littlefs
|
||||||
// Note, memory must be 64-bit aligned
|
// Note, memory must be 64-bit aligned
|
||||||
static inline void *lfs_malloc(size_t size) {
|
static inline void* lfs_malloc(size_t size) {
|
||||||
#ifndef LFS_NO_MALLOC
|
#ifndef LFS_NO_MALLOC
|
||||||
return malloc(size);
|
return malloc(size);
|
||||||
#else
|
#else
|
||||||
@ -175,7 +191,7 @@ static inline void *lfs_malloc(size_t size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Deallocate memory, only used if buffers are not provided to littlefs
|
// Deallocate memory, only used if buffers are not provided to littlefs
|
||||||
static inline void lfs_free(void *p) {
|
static inline void lfs_free(void* p) {
|
||||||
#ifndef LFS_NO_MALLOC
|
#ifndef LFS_NO_MALLOC
|
||||||
free(p);
|
free(p);
|
||||||
#else
|
#else
|
||||||
@ -183,7 +199,6 @@ static inline void lfs_free(void *p) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 1863dc7883d82bd6ca79faa164b65341064d1c16
|
Subproject commit 40dba4a556e0d81dfbe64301a6aa4e18ceca896c
|
@ -12,7 +12,7 @@
|
|||||||
#define UPDATE_ROOT_DIR EXT_PATH("update")
|
#define UPDATE_ROOT_DIR EXT_PATH("update")
|
||||||
|
|
||||||
/* Need at least 4 free LFS pages before update */
|
/* Need at least 4 free LFS pages before update */
|
||||||
#define UPDATE_MIN_INT_FREE_SPACE 4 * 4 * 1024
|
#define UPDATE_MIN_INT_FREE_SPACE 2 * 4 * 1024
|
||||||
|
|
||||||
static const char* update_prepare_result_descr[] = {
|
static const char* update_prepare_result_descr[] = {
|
||||||
[UpdatePrepareResultOK] = "OK",
|
[UpdatePrepareResultOK] = "OK",
|
||||||
|
@ -13,7 +13,7 @@ if not [%FBT_NOENV%] == [] (
|
|||||||
exit /b 0
|
exit /b 0
|
||||||
)
|
)
|
||||||
|
|
||||||
set "FLIPPER_TOOLCHAIN_VERSION=12"
|
set "FLIPPER_TOOLCHAIN_VERSION=15"
|
||||||
set "FBT_TOOLCHAIN_ROOT=%FBT_ROOT%\toolchain\i686-windows"
|
set "FBT_TOOLCHAIN_ROOT=%FBT_ROOT%\toolchain\i686-windows"
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# public variables
|
# public variables
|
||||||
DEFAULT_SCRIPT_PATH="$(pwd -P)";
|
DEFAULT_SCRIPT_PATH="$(pwd -P)";
|
||||||
SCRIPT_PATH="${SCRIPT_PATH:-$DEFAULT_SCRIPT_PATH}";
|
SCRIPT_PATH="${SCRIPT_PATH:-$DEFAULT_SCRIPT_PATH}";
|
||||||
FBT_TOOLCHAIN_VERSION="${FBT_TOOLCHAIN_VERSION:-"12"}";
|
FBT_TOOLCHAIN_VERSION="${FBT_TOOLCHAIN_VERSION:-"15"}";
|
||||||
FBT_TOOLCHAIN_PATH="${FBT_TOOLCHAIN_PATH:-$SCRIPT_PATH}";
|
FBT_TOOLCHAIN_PATH="${FBT_TOOLCHAIN_PATH:-$SCRIPT_PATH}";
|
||||||
|
|
||||||
fbtenv_show_usage()
|
fbtenv_show_usage()
|
||||||
|
Loading…
Reference in New Issue
Block a user