mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-10 06:54:19 +00:00
Merge branch 'fz-dev' into dev
This commit is contained in:
commit
d4a20bc37a
6 changed files with 18 additions and 13 deletions
|
@ -244,7 +244,7 @@ static int32_t rpc_session_worker(void* context) {
|
|||
.callback = rpc_pb_stream_read,
|
||||
.state = session,
|
||||
.errmsg = NULL,
|
||||
.bytes_left = RPC_MAX_MESSAGE_SIZE, /* max incoming message size */
|
||||
.bytes_left = SIZE_MAX,
|
||||
};
|
||||
|
||||
bool message_decode_failed = false;
|
||||
|
|
|
@ -10,7 +10,6 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#define RPC_BUFFER_SIZE (1024)
|
||||
#define RPC_MAX_MESSAGE_SIZE (1536)
|
||||
|
||||
#define RECORD_RPC "rpc"
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "fatfs.h"
|
||||
#include "furi_hal_rtc.h"
|
||||
|
||||
/** logical drive path */
|
||||
char fatfs_path[4];
|
||||
|
@ -9,11 +10,14 @@ void fatfs_init(void) {
|
|||
FATFS_LinkDriver(&sd_fatfs_driver, fatfs_path);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets Time from RTC
|
||||
* @param None
|
||||
* @retval Time in DWORD
|
||||
/** Gets Time from RTC
|
||||
*
|
||||
* @return Time in DWORD (toasters per square washing machine)
|
||||
*/
|
||||
DWORD get_fattime(void) {
|
||||
return 0;
|
||||
DWORD get_fattime() {
|
||||
FuriHalRtcDateTime furi_time;
|
||||
furi_hal_rtc_get_datetime(&furi_time);
|
||||
|
||||
return ((uint32_t)(furi_time.year - 1980) << 25) | furi_time.month << 21 |
|
||||
furi_time.day << 16 | furi_time.hour << 11 | furi_time.minute << 5 | furi_time.second;
|
||||
}
|
||||
|
|
|
@ -219,10 +219,7 @@
|
|||
/ When enable exFAT, also LFN needs to be enabled. (_USE_LFN >= 1)
|
||||
/ Note that enabling exFAT discards C89 compatibility. */
|
||||
|
||||
#define _FS_NORTC 1
|
||||
#define _NORTC_MON 7
|
||||
#define _NORTC_MDAY 20
|
||||
#define _NORTC_YEAR 2021
|
||||
#define _FS_NORTC 0
|
||||
/* The option _FS_NORTC switches timestamp functiton. If the system does not have
|
||||
/ any RTC function or valid timestamp is not needed, set _FS_NORTC = 1 to disable
|
||||
/ the timestamp function. All objects modified by FatFs will have a fixed timestamp
|
||||
|
|
|
@ -281,8 +281,10 @@ FuriHalRtcLocaleDateFormat furi_hal_rtc_get_locale_dateformat() {
|
|||
}
|
||||
|
||||
void furi_hal_rtc_set_datetime(FuriHalRtcDateTime* datetime) {
|
||||
furi_check(!FURI_IS_IRQ_MODE());
|
||||
furi_assert(datetime);
|
||||
|
||||
FURI_CRITICAL_ENTER();
|
||||
/* Disable write protection */
|
||||
LL_RTC_DisableWriteProtection(RTC);
|
||||
|
||||
|
@ -319,13 +321,17 @@ void furi_hal_rtc_set_datetime(FuriHalRtcDateTime* datetime) {
|
|||
|
||||
/* Enable write protection */
|
||||
LL_RTC_EnableWriteProtection(RTC);
|
||||
FURI_CRITICAL_EXIT();
|
||||
}
|
||||
|
||||
void furi_hal_rtc_get_datetime(FuriHalRtcDateTime* datetime) {
|
||||
furi_check(!FURI_IS_IRQ_MODE());
|
||||
furi_assert(datetime);
|
||||
|
||||
FURI_CRITICAL_ENTER();
|
||||
uint32_t time = LL_RTC_TIME_Get(RTC); // 0x00HHMMSS
|
||||
uint32_t date = LL_RTC_DATE_Get(RTC); // 0xWWDDMMYY
|
||||
FURI_CRITICAL_EXIT();
|
||||
|
||||
datetime->second = __LL_RTC_CONVERT_BCD2BIN((time >> 0) & 0xFF);
|
||||
datetime->minute = __LL_RTC_CONVERT_BCD2BIN((time >> 8) & 0xFF);
|
||||
|
|
|
@ -37,7 +37,6 @@ DSTATUS disk_status (BYTE pdrv);
|
|||
DRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count);
|
||||
DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count);
|
||||
DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
|
||||
DWORD get_fattime (void);
|
||||
|
||||
/* Disk Status Bits (DSTATUS) */
|
||||
|
||||
|
|
Loading…
Reference in a new issue