Skip to content

Commit

Permalink
misc. CC13XX port improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Jun 10, 2020
1 parent 9082134 commit f7303db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
6 changes: 3 additions & 3 deletions software/firmware/source/SoftRF/Platform_CC13XX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ HardwareSerial Serial2(1, Uart2_ReadCallback, Uart2_WriteCallback, true);
#include <ti/drivers/dpl/HwiP.h>
#include <ti/devices/cc13x2_cc26x2/driverlib/flash.h>

extern const imgHdr_t _imgHdr;

// Boot check timings in milliseconds
#define BOOTCHECK_SLEEP_DURATION_MS 5000
#define BOOTCHECK_SLEEP_INTERVAL_MS 200

static void RevertToFactoryImage(void)
{
extern const imgHdr_t _imgHdr;

uint32_t key = HwiP_disable();

uint8_t invalidCrc = CRC_INVALID;
Expand Down Expand Up @@ -169,7 +169,7 @@ static void BootManagerCheck(void)
uint8_t leds[] = {RED_LED, GREEN_LED, SOC_GPIO_PIN_LED_BLUE};
uint8_t LED_count = (cc13xx_board == TI_LPSTK_CC1352R ? 3 : 2);

if (revertIoInit)
if (&_imgHdr == NULL && revertIoInit)
{
Serial.println(F("Left button was held on reset."));
Serial.println(F("Continue holding for 5 seconds to revert to factory image."));
Expand Down
28 changes: 9 additions & 19 deletions software/firmware/source/UATbridge/UATbridge.ino
Original file line number Diff line number Diff line change
Expand Up @@ -243,19 +243,13 @@ void setup() {
Serial.println(hw_info.rf);
#endif

init_fec();

if (settings->rf_protocol == RF_PROTOCOL_LEGACY) {
hw_info.gnss = GNSS_setup();

#if defined(DEBUG_UAT)
if (hw_info.gnss != GNSS_MODULE_NONE) {
settings->nmea_g = true;
settings->nmea_out = NMEA_UART;
}
#endif
if ( hw_info.rf != RF_IC_CC13XX ||
(hw_info.rf == RF_IC_CC13XX && settings->rf_protocol != RF_PROTOCOL_ADSB_UAT)) {
init_fec();
}

hw_info.gnss = GNSS_setup();

Serial.print(F("Protocol: "));
Serial.println(
settings->rf_protocol == RF_PROTOCOL_LEGACY ? legacy_proto_desc.name :
Expand Down Expand Up @@ -288,10 +282,8 @@ void setup() {

void loop() {

if (settings->rf_protocol == RF_PROTOCOL_LEGACY) {
PickGNSSFix();
GNSSTimeSync();
}
PickGNSSFix();
GNSSTimeSync();

if (hw_info.rf != RF_IC_CC13XX) {
RF_loop();
Expand Down Expand Up @@ -458,11 +450,9 @@ void shutdown(const char *msg)
{
SoC->WDT_fini();

if (settings->rf_protocol == RF_PROTOCOL_LEGACY) {
GNSS_fini();
GNSS_fini();

SoC->swSer_enableRx(false);
}
SoC->swSer_enableRx(false);

SoC->Display_fini(msg);

Expand Down

0 comments on commit f7303db

Please sign in to comment.