Merge branch 'fz-dev' into dev

This commit is contained in:
MX 2023-04-01 17:41:05 +03:00
commit d4a20bc37a
No known key found for this signature in database
GPG key ID: 7CCC66B7DBDD1C83
6 changed files with 18 additions and 13 deletions

View file

@ -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;

View file

@ -10,7 +10,6 @@ extern "C" {
#endif
#define RPC_BUFFER_SIZE (1024)
#define RPC_MAX_MESSAGE_SIZE (1536)
#define RECORD_RPC "rpc"

View file

@ -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;
}

View file

@ -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

View file

@ -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);

View file

@ -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) */