From 2acaaa65ac552518091eda6782ccc702740b8a26 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 8 Sep 2020 23:46:17 +0200 Subject: [PATCH] stm32-sx1280: add buffer write/read check on startup --- chipset/sx128x/ll_sx1280.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/chipset/sx128x/ll_sx1280.c b/chipset/sx128x/ll_sx1280.c index f3ee45a64..2591c8c1d 100644 --- a/chipset/sx128x/ll_sx1280.c +++ b/chipset/sx128x/ll_sx1280.c @@ -791,6 +791,7 @@ void ll_init(void){ } void ll_radio_on(void){ + Radio.Init( (RadioCallbacks_t *) &Callbacks ); Radio.SetRegulatorMode( USE_DCDC ); // Can also be set in LDO mode but consume more power Radio.SetInterruptMode( ); @@ -811,6 +812,17 @@ void ll_radio_on(void){ // Go back to Frequcency Synthesis Mode, reduces transition time between Rx<->TX Radio.SetAutoFS(1); + // quick test + uint8_t data[] = { 1, 2, 4, 8, 16, 32, 64, 128 }; + Radio.WriteBuffer(0, data, sizeof(data)); + uint8_t check[8]; + Radio.ReadBuffer(0, check, sizeof(data)); + if (memcmp(data, check, sizeof(data)) != 0){ + printf_hexdump(data, sizeof(data)); + printf_hexdump(check, sizeof(data)); + btstack_assert(false); + } + ll_state = LL_STATE_STANDBY; }