SubGhz: add timeout to subghz_hal_async_tx_test_run (#2975)
* SubGhz: add timeout to subghz_hal_async_tx_test_run * Removed full API from unit_test build config --------- Co-authored-by: hedger <hedger@nanode.su> Co-authored-by: hedger <hedger@users.noreply.github.com>
This commit is contained in:
parent
a7f0f5ad27
commit
b90e2ca342
@ -3,6 +3,7 @@ App(
|
|||||||
apptype=FlipperAppType.STARTUP,
|
apptype=FlipperAppType.STARTUP,
|
||||||
entry_point="unit_tests_on_system_start",
|
entry_point="unit_tests_on_system_start",
|
||||||
cdefines=["APP_UNIT_TESTS"],
|
cdefines=["APP_UNIT_TESTS"],
|
||||||
|
requires=["system_settings"],
|
||||||
provides=["delay_test"],
|
provides=["delay_test"],
|
||||||
order=100,
|
order=100,
|
||||||
)
|
)
|
||||||
|
|||||||
@ -330,7 +330,12 @@ bool subghz_hal_async_tx_test_run(SubGhzHalAsyncTxTestType type) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FuriHalCortexTimer timer = furi_hal_cortex_timer_get(30000000);
|
||||||
|
|
||||||
while(!furi_hal_subghz_is_async_tx_complete()) {
|
while(!furi_hal_subghz_is_async_tx_complete()) {
|
||||||
|
if(furi_hal_cortex_timer_is_expired(timer)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
furi_delay_ms(10);
|
furi_delay_ms(10);
|
||||||
}
|
}
|
||||||
furi_hal_subghz_stop_async_tx();
|
furi_hal_subghz_stop_async_tx();
|
||||||
|
|||||||
@ -10,6 +10,19 @@
|
|||||||
|
|
||||||
static_assert(!has_hash_collisions(elf_api_table), "Detected API method hash collision!");
|
static_assert(!has_hash_collisions(elf_api_table), "Detected API method hash collision!");
|
||||||
|
|
||||||
|
#ifdef APP_UNIT_TESTS
|
||||||
|
constexpr HashtableApiInterface mock_elf_api_interface{
|
||||||
|
{
|
||||||
|
.api_version_major = 0,
|
||||||
|
.api_version_minor = 0,
|
||||||
|
.resolver_callback = &elf_resolve_from_hashtable,
|
||||||
|
},
|
||||||
|
.table_cbegin = nullptr,
|
||||||
|
.table_cend = nullptr,
|
||||||
|
};
|
||||||
|
|
||||||
|
const ElfApiInterface* const firmware_api_interface = &mock_elf_api_interface;
|
||||||
|
#else
|
||||||
constexpr HashtableApiInterface elf_api_interface{
|
constexpr HashtableApiInterface elf_api_interface{
|
||||||
{
|
{
|
||||||
.api_version_major = (elf_api_version >> 16),
|
.api_version_major = (elf_api_version >> 16),
|
||||||
@ -19,10 +32,10 @@ constexpr HashtableApiInterface elf_api_interface{
|
|||||||
.table_cbegin = elf_api_table.cbegin(),
|
.table_cbegin = elf_api_table.cbegin(),
|
||||||
.table_cend = elf_api_table.cend(),
|
.table_cend = elf_api_table.cend(),
|
||||||
};
|
};
|
||||||
|
|
||||||
const ElfApiInterface* const firmware_api_interface = &elf_api_interface;
|
const ElfApiInterface* const firmware_api_interface = &elf_api_interface;
|
||||||
|
#endif
|
||||||
|
|
||||||
extern "C" void furi_hal_info_get_api_version(uint16_t* major, uint16_t* minor) {
|
extern "C" void furi_hal_info_get_api_version(uint16_t* major, uint16_t* minor) {
|
||||||
*major = elf_api_interface.api_version_major;
|
*major = firmware_api_interface->api_version_major;
|
||||||
*minor = elf_api_interface.api_version_minor;
|
*minor = firmware_api_interface->api_version_minor;
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user