1
0
mirror of https://github.com/CovidBraceletPrj/CovidBracelet.git synced 2024-12-04 16:45:43 +01:00

Add configuration options to test protobuf unpacking at startup

This commit is contained in:
Hendrik Sauer 2021-12-08 17:44:42 +01:00 committed by Patrick Rathje
parent c172fbced8
commit 152fc4fb7e
3 changed files with 25 additions and 1 deletions

View File

@ -15,12 +15,19 @@
#include "covid_types.h"
#include "ens/storage.h"
#include "exposure-notification.h"
#include "extract_keys.h"
#include "gatt_service.h"
#include "io.h"
#include "display.h"
void main(void) {
#if CONFIG_TEST_UNPACK_KEYS
for (int i = 0; i < CONFIG_TEST_UNPACK_KEYS_N; i++) {
test_unpacking(1 << i);
}
#endif
int err = 0;
printk("Starting Covid Contact Tracer\n");

View File

@ -7,4 +7,17 @@ config ENS_MAX_CONTACTS
help
The maximum amount of contacts, that can be stored on the devies. Needs to be a power of 2!
endmenu
endmenu
menu "Protobuf"
config TEST_UNPACK_KEYS_N
int ""
default 0
config TEST_UNPACK_KEYS
bool ""
default n
select TIMING_FUNCTIONS
endmenu

View File

@ -41,3 +41,7 @@ CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_ENS_MAX_CONTACTS=65536
CONFIG_LOG=y
# # Run protobuf unpack tests at startup
# CONFIG_TEST_UNPACK_KEYS_N=12
# CONFIG_TEST_UNPACK_KEYS=y