mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-24 05:48:08 +03:00
Merge branch 'dev' into patch-custom-font
This commit is contained in:
commit
fcd3799aee
1
.github/workflows/unit_tests.yml
vendored
1
.github/workflows/unit_tests.yml
vendored
@ -56,6 +56,7 @@ jobs:
|
|||||||
- name: 'Run units and validate results'
|
- name: 'Run units and validate results'
|
||||||
id: run_units
|
id: run_units
|
||||||
if: steps.copy.outcome == 'success'
|
if: steps.copy.outcome == 'success'
|
||||||
|
timeout-minutes: 2.5
|
||||||
run: |
|
run: |
|
||||||
source scripts/toolchain/fbtenv.sh
|
source scripts/toolchain/fbtenv.sh
|
||||||
python3 scripts/testing/units.py ${{steps.device.outputs.flipper}}
|
python3 scripts/testing/units.py ${{steps.device.outputs.flipper}}
|
||||||
|
7
.github/workflows/updater_test.yml
vendored
7
.github/workflows/updater_test.yml
vendored
@ -10,7 +10,7 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test_updater_on_bench:
|
test_updater_on_bench:
|
||||||
runs-on: [self-hosted, FlipperZeroTest] # currently on same bench as units, needs different bench
|
runs-on: [self-hosted, FlipperZeroTestMac1]
|
||||||
steps:
|
steps:
|
||||||
- name: 'Decontaminate previous build leftovers'
|
- name: 'Decontaminate previous build leftovers'
|
||||||
run: |
|
run: |
|
||||||
@ -27,7 +27,8 @@ jobs:
|
|||||||
- name: 'Get flipper from device manager (mock)'
|
- name: 'Get flipper from device manager (mock)'
|
||||||
id: device
|
id: device
|
||||||
run: |
|
run: |
|
||||||
echo "flipper=/dev/ttyACM0" >> $GITHUB_OUTPUT
|
echo "flipper=/dev/tty.usbmodemflip_Rekigyn1" >> $GITHUB_OUTPUT
|
||||||
|
echo "stlink=0F020D026415303030303032" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: 'Flashing target firmware'
|
- name: 'Flashing target firmware'
|
||||||
id: first_full_flash
|
id: first_full_flash
|
||||||
@ -67,7 +68,7 @@ jobs:
|
|||||||
- name: 'Flash last release'
|
- name: 'Flash last release'
|
||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
./fbt flash OPENOCD_ADAPTER_SERIAL=2A0906016415303030303032 FORCE=1
|
./fbt flash OPENOCD_ADAPTER_SERIAL=${{steps.device.outputs.stlink}} FORCE=1
|
||||||
|
|
||||||
- name: 'Wait for flipper and format ext'
|
- name: 'Wait for flipper and format ext'
|
||||||
if: failure()
|
if: failure()
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include <furi.h>
|
#include <furi.h>
|
||||||
#include <furi_hal.h>
|
#include <furi_hal.h>
|
||||||
|
#include <stm32_adafruit_sd.h>
|
||||||
|
|
||||||
#include <cli/cli.h>
|
#include <cli/cli.h>
|
||||||
#include <lib/toolbox/args.h>
|
#include <lib/toolbox/args.h>
|
||||||
@ -60,17 +61,28 @@ static void storage_cli_info(Cli* cli, FuriString* path) {
|
|||||||
}
|
}
|
||||||
} else if(furi_string_cmp_str(path, STORAGE_EXT_PATH_PREFIX) == 0) {
|
} else if(furi_string_cmp_str(path, STORAGE_EXT_PATH_PREFIX) == 0) {
|
||||||
SDInfo sd_info;
|
SDInfo sd_info;
|
||||||
|
SD_CID sd_cid;
|
||||||
FS_Error error = storage_sd_info(api, &sd_info);
|
FS_Error error = storage_sd_info(api, &sd_info);
|
||||||
|
BSP_SD_GetCIDRegister(&sd_cid);
|
||||||
|
|
||||||
if(error != FSE_OK) {
|
if(error != FSE_OK) {
|
||||||
storage_cli_print_error(error);
|
storage_cli_print_error(error);
|
||||||
} else {
|
} else {
|
||||||
printf(
|
printf(
|
||||||
"Label: %s\r\nType: %s\r\n%luKiB total\r\n%luKiB free\r\n",
|
"Label: %s\r\nType: %s\r\n%luKiB total\r\n%luKiB free\r\n"
|
||||||
|
"%02x%2.2s %5.5s %i.%i\r\nSN:%04lx %02i/%i\r\n",
|
||||||
sd_info.label,
|
sd_info.label,
|
||||||
sd_api_get_fs_type_text(sd_info.fs_type),
|
sd_api_get_fs_type_text(sd_info.fs_type),
|
||||||
sd_info.kb_total,
|
sd_info.kb_total,
|
||||||
sd_info.kb_free);
|
sd_info.kb_free,
|
||||||
|
sd_cid.ManufacturerID,
|
||||||
|
sd_cid.OEM_AppliID,
|
||||||
|
sd_cid.ProdName,
|
||||||
|
sd_cid.ProdRev >> 4,
|
||||||
|
sd_cid.ProdRev & 0xf,
|
||||||
|
sd_cid.ProdSN,
|
||||||
|
sd_cid.ManufactMonth,
|
||||||
|
sd_cid.ManufactYear + 2000);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
storage_cli_print_usage();
|
storage_cli_print_usage();
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include "../storage_settings.h"
|
#include "../storage_settings.h"
|
||||||
|
#include <stm32_adafruit_sd.h>
|
||||||
|
|
||||||
static void storage_settings_scene_sd_info_dialog_callback(DialogExResult result, void* context) {
|
static void storage_settings_scene_sd_info_dialog_callback(DialogExResult result, void* context) {
|
||||||
StorageSettings* app = context;
|
StorageSettings* app = context;
|
||||||
@ -11,7 +12,10 @@ void storage_settings_scene_sd_info_on_enter(void* context) {
|
|||||||
DialogEx* dialog_ex = app->dialog_ex;
|
DialogEx* dialog_ex = app->dialog_ex;
|
||||||
|
|
||||||
SDInfo sd_info;
|
SDInfo sd_info;
|
||||||
|
SD_CID sd_cid;
|
||||||
FS_Error sd_status = storage_sd_info(app->fs_api, &sd_info);
|
FS_Error sd_status = storage_sd_info(app->fs_api, &sd_info);
|
||||||
|
BSP_SD_GetCIDRegister(&sd_cid);
|
||||||
|
|
||||||
scene_manager_set_scene_state(app->scene_manager, StorageSettingsSDInfo, sd_status);
|
scene_manager_set_scene_state(app->scene_manager, StorageSettingsSDInfo, sd_status);
|
||||||
|
|
||||||
dialog_ex_set_context(dialog_ex, app);
|
dialog_ex_set_context(dialog_ex, app);
|
||||||
@ -26,13 +30,22 @@ void storage_settings_scene_sd_info_on_enter(void* context) {
|
|||||||
} else {
|
} else {
|
||||||
furi_string_printf(
|
furi_string_printf(
|
||||||
app->text_string,
|
app->text_string,
|
||||||
"Label: %s\nType: %s\n%lu KiB total\n%lu KiB free",
|
"Label: %s\nType: %s\n%lu KiB total\n%lu KiB free\n"
|
||||||
|
"%02X%2.2s %5.5s %i.%i\nSN:%04lX %02i/%i",
|
||||||
sd_info.label,
|
sd_info.label,
|
||||||
sd_api_get_fs_type_text(sd_info.fs_type),
|
sd_api_get_fs_type_text(sd_info.fs_type),
|
||||||
sd_info.kb_total,
|
sd_info.kb_total,
|
||||||
sd_info.kb_free);
|
sd_info.kb_free,
|
||||||
|
sd_cid.ManufacturerID,
|
||||||
|
sd_cid.OEM_AppliID,
|
||||||
|
sd_cid.ProdName,
|
||||||
|
sd_cid.ProdRev >> 4,
|
||||||
|
sd_cid.ProdRev & 0xf,
|
||||||
|
sd_cid.ProdSN,
|
||||||
|
sd_cid.ManufactMonth,
|
||||||
|
sd_cid.ManufactYear + 2000);
|
||||||
dialog_ex_set_text(
|
dialog_ex_set_text(
|
||||||
dialog_ex, furi_string_get_cstr(app->text_string), 4, 4, AlignLeft, AlignTop);
|
dialog_ex, furi_string_get_cstr(app->text_string), 4, 1, AlignLeft, AlignTop);
|
||||||
}
|
}
|
||||||
|
|
||||||
view_dispatcher_switch_to_view(app->view_dispatcher, StorageSettingsViewDialogEx);
|
view_dispatcher_switch_to_view(app->view_dispatcher, StorageSettingsViewDialogEx);
|
||||||
|
@ -67,6 +67,7 @@ Can be combined with a special key command or a single character.
|
|||||||
|ALT-SHIFT|ALT+SHIFT|
|
|ALT-SHIFT|ALT+SHIFT|
|
||||||
|ALT-GUI|ALT+WIN|
|
|ALT-GUI|ALT+WIN|
|
||||||
|GUI-SHIFT|WIN+SHIFT|
|
|GUI-SHIFT|WIN+SHIFT|
|
||||||
|
|GUI-CTRL|WIN+CTRL|
|
||||||
|
|
||||||
## String
|
## String
|
||||||
|
|
||||||
|
@ -779,25 +779,10 @@ uint8_t SD_GetCIDRegister(SD_CID* Cid) {
|
|||||||
Cid->ManufacturerID = CID_Tab[0];
|
Cid->ManufacturerID = CID_Tab[0];
|
||||||
|
|
||||||
/* Byte 1 */
|
/* Byte 1 */
|
||||||
Cid->OEM_AppliID = CID_Tab[1] << 8;
|
memcpy(Cid->OEM_AppliID, CID_Tab + 1, 2);
|
||||||
|
|
||||||
/* Byte 2 */
|
|
||||||
Cid->OEM_AppliID |= CID_Tab[2];
|
|
||||||
|
|
||||||
/* Byte 3 */
|
/* Byte 3 */
|
||||||
Cid->ProdName1 = CID_Tab[3] << 24;
|
memcpy(Cid->ProdName, CID_Tab + 3, 5);
|
||||||
|
|
||||||
/* Byte 4 */
|
|
||||||
Cid->ProdName1 |= CID_Tab[4] << 16;
|
|
||||||
|
|
||||||
/* Byte 5 */
|
|
||||||
Cid->ProdName1 |= CID_Tab[5] << 8;
|
|
||||||
|
|
||||||
/* Byte 6 */
|
|
||||||
Cid->ProdName1 |= CID_Tab[6];
|
|
||||||
|
|
||||||
/* Byte 7 */
|
|
||||||
Cid->ProdName2 = CID_Tab[7];
|
|
||||||
|
|
||||||
/* Byte 8 */
|
/* Byte 8 */
|
||||||
Cid->ProdRev = CID_Tab[8];
|
Cid->ProdRev = CID_Tab[8];
|
||||||
@ -815,11 +800,12 @@ uint8_t SD_GetCIDRegister(SD_CID* Cid) {
|
|||||||
Cid->ProdSN |= CID_Tab[12];
|
Cid->ProdSN |= CID_Tab[12];
|
||||||
|
|
||||||
/* Byte 13 */
|
/* Byte 13 */
|
||||||
Cid->Reserved1 |= (CID_Tab[13] & 0xF0) >> 4;
|
Cid->Reserved1 = (CID_Tab[13] & 0xF0) >> 4;
|
||||||
Cid->ManufactDate = (CID_Tab[13] & 0x0F) << 8;
|
Cid->ManufactYear = (CID_Tab[13] & 0x0F) << 4;
|
||||||
|
|
||||||
/* Byte 14 */
|
/* Byte 14 */
|
||||||
Cid->ManufactDate |= CID_Tab[14];
|
Cid->ManufactYear |= (CID_Tab[14] & 0xF0) >> 4;
|
||||||
|
Cid->ManufactMonth = (CID_Tab[14] & 0x0F);
|
||||||
|
|
||||||
/* Byte 15 */
|
/* Byte 15 */
|
||||||
Cid->CID_CRC = (CID_Tab[15] & 0xFE) >> 1;
|
Cid->CID_CRC = (CID_Tab[15] & 0xFE) >> 1;
|
||||||
@ -837,6 +823,21 @@ uint8_t SD_GetCIDRegister(SD_CID* Cid) {
|
|||||||
return retr;
|
return retr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t BSP_SD_GetCIDRegister(SD_CID* Cid) {
|
||||||
|
uint8_t retr = BSP_SD_ERROR;
|
||||||
|
|
||||||
|
/* Slow speed init */
|
||||||
|
furi_hal_spi_acquire(&furi_hal_spi_bus_handle_sd_slow);
|
||||||
|
furi_hal_sd_spi_handle = &furi_hal_spi_bus_handle_sd_slow;
|
||||||
|
|
||||||
|
memset(Cid, 0, sizeof(SD_CID));
|
||||||
|
retr = SD_GetCIDRegister(Cid);
|
||||||
|
|
||||||
|
furi_hal_sd_spi_handle = NULL;
|
||||||
|
furi_hal_spi_release(&furi_hal_spi_bus_handle_sd_slow);
|
||||||
|
return retr;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sends 5 bytes command to the SD card and get response
|
* @brief Sends 5 bytes command to the SD card and get response
|
||||||
* @param Cmd: The user expected command to send to SD card.
|
* @param Cmd: The user expected command to send to SD card.
|
||||||
|
@ -133,16 +133,16 @@ typedef struct {
|
|||||||
* @brief Card Identification Data: CID Register
|
* @brief Card Identification Data: CID Register
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
__IO uint8_t ManufacturerID; /* ManufacturerID */
|
uint8_t ManufacturerID; /* ManufacturerID */
|
||||||
__IO uint16_t OEM_AppliID; /* OEM/Application ID */
|
char OEM_AppliID[2]; /* OEM/Application ID */
|
||||||
__IO uint32_t ProdName1; /* Product Name part1 */
|
char ProdName[5]; /* Product Name */
|
||||||
__IO uint8_t ProdName2; /* Product Name part2*/
|
uint8_t ProdRev; /* Product Revision */
|
||||||
__IO uint8_t ProdRev; /* Product Revision */
|
uint32_t ProdSN; /* Product Serial Number */
|
||||||
__IO uint32_t ProdSN; /* Product Serial Number */
|
uint8_t Reserved1; /* Reserved1 */
|
||||||
__IO uint8_t Reserved1; /* Reserved1 */
|
uint8_t ManufactYear; /* Manufacturing Year */
|
||||||
__IO uint16_t ManufactDate; /* Manufacturing Date */
|
uint8_t ManufactMonth; /* Manufacturing Month */
|
||||||
__IO uint8_t CID_CRC; /* CID CRC */
|
uint8_t CID_CRC; /* CID CRC */
|
||||||
__IO uint8_t Reserved2; /* always 1 */
|
uint8_t Reserved2; /* always 1 */
|
||||||
} SD_CID;
|
} SD_CID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -207,6 +207,7 @@ uint8_t
|
|||||||
uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr);
|
uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr);
|
||||||
uint8_t BSP_SD_GetCardState(void);
|
uint8_t BSP_SD_GetCardState(void);
|
||||||
uint8_t BSP_SD_GetCardInfo(SD_CardInfo* pCardInfo);
|
uint8_t BSP_SD_GetCardInfo(SD_CardInfo* pCardInfo);
|
||||||
|
uint8_t BSP_SD_GetCIDRegister(SD_CID* Cid);
|
||||||
|
|
||||||
/* Link functions for SD Card peripheral*/
|
/* Link functions for SD Card peripheral*/
|
||||||
void SD_SPI_Slow_Init(void);
|
void SD_SPI_Slow_Init(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user