Merge branch 'dev' into zlo/allocator-playground

This commit is contained in:
SG
2024-04-08 04:06:28 +03:00
10 changed files with 28 additions and 11 deletions

View File

@@ -612,7 +612,7 @@ void infrared_worker_set_raw_signal(
furi_check(timings); furi_check(timings);
furi_check(timings_cnt > 0); furi_check(timings_cnt > 0);
furi_check((frequency <= INFRARED_MAX_FREQUENCY) && (frequency >= INFRARED_MIN_FREQUENCY)); furi_check((frequency <= INFRARED_MAX_FREQUENCY) && (frequency >= INFRARED_MIN_FREQUENCY));
furi_check((duty_cycle < 1.0f) && (duty_cycle > 0.0f)); furi_check((duty_cycle <= 1.0f) && (duty_cycle > 0.0f));
size_t max_copy_num = COUNT_OF(instance->signal.raw.timings) - 1; size_t max_copy_num = COUNT_OF(instance->signal.raw.timings) - 1;
furi_check(timings_cnt <= max_copy_num); furi_check(timings_cnt <= max_copy_num);

View File

@@ -48,6 +48,7 @@ env.Append(
File("helpers/iso14443_crc.h"), File("helpers/iso14443_crc.h"),
File("helpers/iso13239_crc.h"), File("helpers/iso13239_crc.h"),
File("helpers/nfc_data_generator.h"), File("helpers/nfc_data_generator.h"),
File("helpers/crypto1.h"),
], ],
) )

View File

@@ -3,7 +3,7 @@
#include "mf_classic_listener.h" #include "mf_classic_listener.h"
#include <lib/nfc/protocols/iso14443_3a/iso14443_3a_listener_i.h> #include <lib/nfc/protocols/iso14443_3a/iso14443_3a_listener_i.h>
#include <nfc/protocols/nfc_generic_event.h> #include <nfc/protocols/nfc_generic_event.h>
#include "crypto1.h" #include <nfc/helpers/crypto1.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@@ -3,7 +3,7 @@
#include "mf_classic_poller.h" #include "mf_classic_poller.h"
#include <lib/nfc/protocols/iso14443_3a/iso14443_3a_poller_i.h> #include <lib/nfc/protocols/iso14443_3a/iso14443_3a_poller_i.h>
#include <bit_lib/bit_lib.h> #include <bit_lib/bit_lib.h>
#include "crypto1.h" #include <nfc/helpers/crypto1.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@@ -1,5 +1,5 @@
entry,status,name,type,params entry,status,name,type,params
Version,+,61.0,, Version,+,60.5,,
Header,+,applications/services/bt/bt_service/bt.h,, Header,+,applications/services/bt/bt_service/bt.h,,
Header,+,applications/services/cli/cli.h,, Header,+,applications/services/cli/cli.h,,
Header,+,applications/services/cli/cli_vcp.h,, Header,+,applications/services/cli/cli_vcp.h,,
@@ -1980,7 +1980,7 @@ Function,+,memmgr_heap_disable_thread_trace,void,FuriThreadId
Function,+,memmgr_heap_enable_thread_trace,void,FuriThreadId Function,+,memmgr_heap_enable_thread_trace,void,FuriThreadId
Function,+,memmgr_heap_get_max_free_block,size_t, Function,+,memmgr_heap_get_max_free_block,size_t,
Function,+,memmgr_heap_get_thread_memory,size_t,FuriThreadId Function,+,memmgr_heap_get_thread_memory,size_t,FuriThreadId
Function,+,memmgr_heap_walk_blocks,void,"BlockWalker, void*" Function,+,memmgr_heap_printf_free_blocks,void,
Function,-,memmgr_pool_get_free,size_t, Function,-,memmgr_pool_get_free,size_t,
Function,-,memmgr_pool_get_max_block,size_t, Function,-,memmgr_pool_get_max_block,size_t,
Function,+,memmove,void*,"void*, const void*, size_t" Function,+,memmove,void*,"void*, const void*, size_t"
1 entry status name type params
2 Version + 61.0 60.5
3 Header + applications/services/bt/bt_service/bt.h
4 Header + applications/services/cli/cli.h
5 Header + applications/services/cli/cli_vcp.h
1980 Function + memmgr_heap_enable_thread_trace void FuriThreadId
1981 Function + memmgr_heap_get_max_free_block size_t
1982 Function + memmgr_heap_get_thread_memory size_t FuriThreadId
1983 Function + memmgr_heap_walk_blocks memmgr_heap_printf_free_blocks void BlockWalker, void*
1984 Function - memmgr_pool_get_free size_t
1985 Function - memmgr_pool_get_max_block size_t
1986 Function + memmove void* void*, const void*, size_t

View File

@@ -1,5 +1,5 @@
entry,status,name,type,params entry,status,name,type,params
Version,+,61.0,, Version,+,60.5,,
Header,+,applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h,, Header,+,applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h,,
Header,+,applications/services/bt/bt_service/bt.h,, Header,+,applications/services/bt/bt_service/bt.h,,
Header,+,applications/services/cli/cli.h,, Header,+,applications/services/cli/cli.h,,
@@ -123,6 +123,7 @@ Header,+,lib/music_worker/music_worker.h,,
Header,+,lib/nanopb/pb.h,, Header,+,lib/nanopb/pb.h,,
Header,+,lib/nanopb/pb_decode.h,, Header,+,lib/nanopb/pb_decode.h,,
Header,+,lib/nanopb/pb_encode.h,, Header,+,lib/nanopb/pb_encode.h,,
Header,+,lib/nfc/helpers/crypto1.h,,
Header,+,lib/nfc/helpers/iso13239_crc.h,, Header,+,lib/nfc/helpers/iso13239_crc.h,,
Header,+,lib/nfc/helpers/iso14443_crc.h,, Header,+,lib/nfc/helpers/iso14443_crc.h,,
Header,+,lib/nfc/helpers/nfc_data_generator.h,, Header,+,lib/nfc/helpers/nfc_data_generator.h,,
@@ -853,6 +854,16 @@ Function,-,coshl,long double,long double
Function,-,cosl,long double,long double Function,-,cosl,long double,long double
Function,+,crc32_calc_buffer,uint32_t,"uint32_t, const void*, size_t" Function,+,crc32_calc_buffer,uint32_t,"uint32_t, const void*, size_t"
Function,+,crc32_calc_file,uint32_t,"File*, const FileCrcProgressCb, void*" Function,+,crc32_calc_file,uint32_t,"File*, const FileCrcProgressCb, void*"
Function,+,crypto1_alloc,Crypto1*,
Function,+,crypto1_bit,uint8_t,"Crypto1*, uint8_t, int"
Function,+,crypto1_byte,uint8_t,"Crypto1*, uint8_t, int"
Function,+,crypto1_decrypt,void,"Crypto1*, const BitBuffer*, BitBuffer*"
Function,+,crypto1_encrypt,void,"Crypto1*, uint8_t*, const BitBuffer*, BitBuffer*"
Function,+,crypto1_encrypt_reader_nonce,void,"Crypto1*, uint64_t, uint32_t, uint8_t*, uint8_t*, BitBuffer*, _Bool"
Function,+,crypto1_free,void,Crypto1*
Function,+,crypto1_init,void,"Crypto1*, uint64_t"
Function,+,crypto1_reset,void,Crypto1*
Function,+,crypto1_word,uint32_t,"Crypto1*, uint32_t, int"
Function,-,ctermid,char*,char* Function,-,ctermid,char*,char*
Function,-,cuserid,char*,char* Function,-,cuserid,char*,char*
Function,+,datetime_datetime_to_timestamp,uint32_t,DateTime* Function,+,datetime_datetime_to_timestamp,uint32_t,DateTime*
@@ -2360,7 +2371,7 @@ Function,+,memmgr_heap_disable_thread_trace,void,FuriThreadId
Function,+,memmgr_heap_enable_thread_trace,void,FuriThreadId Function,+,memmgr_heap_enable_thread_trace,void,FuriThreadId
Function,+,memmgr_heap_get_max_free_block,size_t, Function,+,memmgr_heap_get_max_free_block,size_t,
Function,+,memmgr_heap_get_thread_memory,size_t,FuriThreadId Function,+,memmgr_heap_get_thread_memory,size_t,FuriThreadId
Function,+,memmgr_heap_walk_blocks,void,"BlockWalker, void*" Function,+,memmgr_heap_printf_free_blocks,void,
Function,-,memmgr_pool_get_free,size_t, Function,-,memmgr_pool_get_free,size_t,
Function,-,memmgr_pool_get_max_block,size_t, Function,-,memmgr_pool_get_max_block,size_t,
Function,+,memmove,void*,"void*, const void*, size_t" Function,+,memmove,void*,"void*, const void*, size_t"
@@ -2782,6 +2793,7 @@ Function,+,powf,float,"float, float"
Function,-,powl,long double,"long double, long double" Function,-,powl,long double,"long double, long double"
Function,+,pretty_format_bytes_hex_canonical,void,"FuriString*, size_t, const char*, const uint8_t*, size_t" Function,+,pretty_format_bytes_hex_canonical,void,"FuriString*, size_t, const char*, const uint8_t*, size_t"
Function,-,printf,int,"const char*, ..." Function,-,printf,int,"const char*, ..."
Function,+,prng_successor,uint32_t,"uint32_t, uint32_t"
Function,+,property_value_out,void,"PropertyValueContext*, const char*, unsigned int, ..." Function,+,property_value_out,void,"PropertyValueContext*, const char*, unsigned int, ..."
Function,+,protocol_dict_alloc,ProtocolDict*,"const ProtocolBase**, size_t" Function,+,protocol_dict_alloc,ProtocolDict*,"const ProtocolBase**, size_t"
Function,+,protocol_dict_decoders_feed,ProtocolId,"ProtocolDict*, _Bool, uint32_t" Function,+,protocol_dict_decoders_feed,ProtocolId,"ProtocolDict*, _Bool, uint32_t"
1 entry status name type params
2 Version + 61.0 60.5
3 Header + applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h
4 Header + applications/services/bt/bt_service/bt.h
5 Header + applications/services/cli/cli.h
123 Header + lib/nanopb/pb.h
124 Header + lib/nanopb/pb_decode.h
125 Header + lib/nanopb/pb_encode.h
126 Header + lib/nfc/helpers/crypto1.h
127 Header + lib/nfc/helpers/iso13239_crc.h
128 Header + lib/nfc/helpers/iso14443_crc.h
129 Header + lib/nfc/helpers/nfc_data_generator.h
854 Function - cosl long double long double
855 Function + crc32_calc_buffer uint32_t uint32_t, const void*, size_t
856 Function + crc32_calc_file uint32_t File*, const FileCrcProgressCb, void*
857 Function + crypto1_alloc Crypto1*
858 Function + crypto1_bit uint8_t Crypto1*, uint8_t, int
859 Function + crypto1_byte uint8_t Crypto1*, uint8_t, int
860 Function + crypto1_decrypt void Crypto1*, const BitBuffer*, BitBuffer*
861 Function + crypto1_encrypt void Crypto1*, uint8_t*, const BitBuffer*, BitBuffer*
862 Function + crypto1_encrypt_reader_nonce void Crypto1*, uint64_t, uint32_t, uint8_t*, uint8_t*, BitBuffer*, _Bool
863 Function + crypto1_free void Crypto1*
864 Function + crypto1_init void Crypto1*, uint64_t
865 Function + crypto1_reset void Crypto1*
866 Function + crypto1_word uint32_t Crypto1*, uint32_t, int
867 Function - ctermid char* char*
868 Function - cuserid char* char*
869 Function + datetime_datetime_to_timestamp uint32_t DateTime*
2371 Function + memmgr_heap_enable_thread_trace void FuriThreadId
2372 Function + memmgr_heap_get_max_free_block size_t
2373 Function + memmgr_heap_get_thread_memory size_t FuriThreadId
2374 Function + memmgr_heap_walk_blocks memmgr_heap_printf_free_blocks void BlockWalker, void*
2375 Function - memmgr_pool_get_free size_t
2376 Function - memmgr_pool_get_max_block size_t
2377 Function + memmove void* void*, const void*, size_t
2793 Function - powl long double long double, long double
2794 Function + pretty_format_bytes_hex_canonical void FuriString*, size_t, const char*, const uint8_t*, size_t
2795 Function - printf int const char*, ...
2796 Function + prng_successor uint32_t uint32_t, uint32_t
2797 Function + property_value_out void PropertyValueContext*, const char*, unsigned int, ...
2798 Function + protocol_dict_alloc ProtocolDict* const ProtocolBase**, size_t
2799 Function + protocol_dict_decoders_feed ProtocolId ProtocolDict*, _Bool, uint32_t

View File

@@ -357,7 +357,7 @@ static void furi_hal_infrared_configure_tim_pwm_tx(uint32_t freq, float duty_cyc
if(infrared_tx_output == FuriHalInfraredTxPinInternal) { if(infrared_tx_output == FuriHalInfraredTxPinInternal) {
LL_TIM_OC_SetCompareCH3( LL_TIM_OC_SetCompareCH3(
INFRARED_DMA_TIMER, INFRARED_DMA_TIMER,
((LL_TIM_GetAutoReload(INFRARED_DMA_TIMER) + 1) * (1 - duty_cycle))); ((LL_TIM_GetAutoReload(INFRARED_DMA_TIMER) + 1) * (1.0f - duty_cycle)));
LL_TIM_OC_EnablePreload(INFRARED_DMA_TIMER, LL_TIM_CHANNEL_CH3); LL_TIM_OC_EnablePreload(INFRARED_DMA_TIMER, LL_TIM_CHANNEL_CH3);
/* LL_TIM_OCMODE_PWM2 set by DMA */ /* LL_TIM_OCMODE_PWM2 set by DMA */
LL_TIM_OC_SetMode(INFRARED_DMA_TIMER, LL_TIM_CHANNEL_CH3, LL_TIM_OCMODE_FORCED_INACTIVE); LL_TIM_OC_SetMode(INFRARED_DMA_TIMER, LL_TIM_CHANNEL_CH3, LL_TIM_OCMODE_FORCED_INACTIVE);
@@ -368,7 +368,7 @@ static void furi_hal_infrared_configure_tim_pwm_tx(uint32_t freq, float duty_cyc
} else if(infrared_tx_output == FuriHalInfraredTxPinExtPA7) { } else if(infrared_tx_output == FuriHalInfraredTxPinExtPA7) {
LL_TIM_OC_SetCompareCH1( LL_TIM_OC_SetCompareCH1(
INFRARED_DMA_TIMER, INFRARED_DMA_TIMER,
((LL_TIM_GetAutoReload(INFRARED_DMA_TIMER) + 1) * (1 - duty_cycle))); ((LL_TIM_GetAutoReload(INFRARED_DMA_TIMER) + 1) * (1.0f - duty_cycle)));
LL_TIM_OC_EnablePreload(INFRARED_DMA_TIMER, LL_TIM_CHANNEL_CH1); LL_TIM_OC_EnablePreload(INFRARED_DMA_TIMER, LL_TIM_CHANNEL_CH1);
/* LL_TIM_OCMODE_PWM2 set by DMA */ /* LL_TIM_OCMODE_PWM2 set by DMA */
LL_TIM_OC_SetMode(INFRARED_DMA_TIMER, LL_TIM_CHANNEL_CH1, LL_TIM_OCMODE_FORCED_INACTIVE); LL_TIM_OC_SetMode(INFRARED_DMA_TIMER, LL_TIM_CHANNEL_CH1, LL_TIM_OCMODE_FORCED_INACTIVE);
@@ -609,7 +609,7 @@ static void furi_hal_infrared_async_tx_free_resources(void) {
} }
void furi_hal_infrared_async_tx_start(uint32_t freq, float duty_cycle) { void furi_hal_infrared_async_tx_start(uint32_t freq, float duty_cycle) {
if((duty_cycle > 1) || (duty_cycle <= 0) || (freq > INFRARED_MAX_FREQUENCY) || if((duty_cycle > 1.0f) || (duty_cycle <= 0.0f) || (freq > INFRARED_MAX_FREQUENCY) ||
(freq < INFRARED_MIN_FREQUENCY) || (infrared_tim_tx.data_callback == NULL)) { (freq < INFRARED_MIN_FREQUENCY) || (infrared_tim_tx.data_callback == NULL)) {
furi_crash(); furi_crash();
} }

View File

@@ -6,12 +6,16 @@
extern "C" { extern "C" {
#endif #endif
#define FURI_HAL_RANDOM_MAX 0xFFFFFFFFU
/** Initialize random subsystem */ /** Initialize random subsystem */
void furi_hal_random_init(void); void furi_hal_random_init(void);
/** Get random value /** Get random value
* furi_hal_random_get() gives up to FURI_HAL_RANDOM_MAX
* rand() and random() give up to RAND_MAX
* *
* @return random value * @return 32 bit random value (up to FURI_HAL_RANDOM_MAX)
*/ */
uint32_t furi_hal_random_get(void); uint32_t furi_hal_random_get(void);