2023-03-14 14:29:28 +00:00
|
|
|
#include "firmware_api.h"
|
|
|
|
|
|
|
|
#include <flipper_application/api_hashtable/api_hashtable.h>
|
|
|
|
#include <flipper_application/api_hashtable/compilesort.hpp>
|
|
|
|
|
|
|
|
/* Generated table */
|
2023-04-06 02:44:37 +00:00
|
|
|
#include <firmware_api_table.h>
|
2023-03-14 14:29:28 +00:00
|
|
|
|
2023-05-03 03:58:59 +00:00
|
|
|
#include <furi_hal_info.h>
|
|
|
|
|
2023-03-14 14:29:28 +00:00
|
|
|
static_assert(!has_hash_collisions(elf_api_table), "Detected API method hash collision!");
|
|
|
|
|
2023-08-16 09:16:42 +00:00
|
|
|
#ifdef APP_UNIT_TESTS
|
|
|
|
constexpr HashtableApiInterface mock_elf_api_interface{
|
|
|
|
{
|
|
|
|
.api_version_major = 0,
|
|
|
|
.api_version_minor = 0,
|
|
|
|
.resolver_callback = &elf_resolve_from_hashtable,
|
|
|
|
},
|
2024-02-26 12:16:19 +00:00
|
|
|
nullptr,
|
|
|
|
nullptr,
|
2023-08-16 09:16:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const ElfApiInterface* const firmware_api_interface = &mock_elf_api_interface;
|
|
|
|
#else
|
2023-03-14 14:29:28 +00:00
|
|
|
constexpr HashtableApiInterface elf_api_interface{
|
|
|
|
{
|
|
|
|
.api_version_major = (elf_api_version >> 16),
|
|
|
|
.api_version_minor = (elf_api_version & 0xFFFF),
|
|
|
|
.resolver_callback = &elf_resolve_from_hashtable,
|
|
|
|
},
|
2024-02-26 12:16:19 +00:00
|
|
|
elf_api_table.cbegin(),
|
|
|
|
elf_api_table.cend(),
|
2023-03-14 14:29:28 +00:00
|
|
|
};
|
|
|
|
const ElfApiInterface* const firmware_api_interface = &elf_api_interface;
|
2023-08-16 09:16:42 +00:00
|
|
|
#endif
|
2023-05-03 03:58:59 +00:00
|
|
|
|
|
|
|
extern "C" void furi_hal_info_get_api_version(uint16_t* major, uint16_t* minor) {
|
2023-08-16 09:16:42 +00:00
|
|
|
*major = firmware_api_interface->api_version_major;
|
|
|
|
*minor = firmware_api_interface->api_version_minor;
|
2023-05-03 03:58:59 +00:00
|
|
|
}
|