mirror of
https://github.com/liquidraver/ZephCore.git
synced 2026-09-01 21:08:19 +00:00
legacy code cleanup
This commit is contained in:
+1
-1
@@ -282,7 +282,7 @@ config ZEPHCORE_BLE_ADV_SLOW_INTERVAL
|
||||
|
||||
config ZEPHCORE_BLE_DFU
|
||||
bool "Buttonless BLE DFU (legacy Nordic/Adafruit OTA jump)"
|
||||
depends on SOC_SERIES_NRF52X || SOC_SERIES_NRF52
|
||||
depends on SOC_SERIES_NRF52
|
||||
default y
|
||||
help
|
||||
Register the legacy Nordic DFU service (00001530/00001531) in the
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(CONFIG_SOC_SERIES_NRF52X) || defined(CONFIG_SOC_SERIES_NRF52)
|
||||
#if defined(CONFIG_SOC_SERIES_NRF52)
|
||||
#include <hal/nrf_power.h>
|
||||
/* Adafruit bootloader GPREGRET magic values */
|
||||
#define BOOTLOADER_DFU_SERIAL_MAGIC 0x4e /* Enter serial DFU mode (CDC only) */
|
||||
@@ -246,7 +246,7 @@ bool ZephyrBoard::startOTAUpdate(const char *id, char reply[])
|
||||
|
||||
bool ZephyrBoard::getBootloaderVersion(char *out, size_t max_len)
|
||||
{
|
||||
#if defined(CONFIG_SOC_SERIES_NRF52X) || defined(CONFIG_SOC_SERIES_NRF52)
|
||||
#if defined(CONFIG_SOC_SERIES_NRF52)
|
||||
/* Scan flash for UF2 bootloader version string.
|
||||
* info.txt lives somewhere in the 0xFB000-0xFE000 range depending
|
||||
* on SoftDevice version and bootloader build. */
|
||||
@@ -291,7 +291,7 @@ uint8_t ZephyrBoard::getStartupReason() const
|
||||
|
||||
bool ZephyrBoard::isExternalPowered()
|
||||
{
|
||||
#if defined(CONFIG_SOC_SERIES_NRF52X) || defined(CONFIG_SOC_SERIES_NRF52)
|
||||
#if defined(CONFIG_SOC_SERIES_NRF52)
|
||||
/* VBUS detect from the POWER peripheral — true when USB/charger is
|
||||
* attached. Read-only status register; safe alongside the BLE controller
|
||||
* (we already poke NRF_POWER->GPREGRET directly elsewhere). */
|
||||
|
||||
@@ -2962,8 +2962,7 @@ bool CompanionMesh::handleProtocolFrame(const uint8_t *data, size_t len)
|
||||
/* FIRMWARE_VER_CODE 13+: allow requests to a non-contact pubkey by
|
||||
* creating a transient "anon" contact (ADV_TYPE_NONE). These are never
|
||||
* persisted or synced to the app; re-lookup to get the stable slot. */
|
||||
ContactInfo anon;
|
||||
memset(&anon, 0, sizeof(anon));
|
||||
ContactInfo anon{};
|
||||
memcpy(anon.id.pub_key, &data[1], PUB_KEY_SIZE);
|
||||
anon.out_path_len = 0; // zero-hop direct by default
|
||||
anon.type = ADV_TYPE_NONE; // transient/unknown
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <zephyr/sys/reboot.h>
|
||||
#include "qspi_probe.h"
|
||||
|
||||
#if defined(CONFIG_SOC_SERIES_NRF52X) || defined(CONFIG_SOC_SERIES_NRF52)
|
||||
#if defined(CONFIG_SOC_SERIES_NRF52)
|
||||
#include <hal/nrf_power.h>
|
||||
#define IS_NRF52 1
|
||||
#else
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "lr1110_bootloader.h"
|
||||
#include "lr1110_transceiver_0401.h"
|
||||
|
||||
#if defined(CONFIG_SOC_SERIES_NRF52X) || defined(CONFIG_SOC_SERIES_NRF52)
|
||||
#if defined(CONFIG_SOC_SERIES_NRF52)
|
||||
#include <hal/nrf_power.h>
|
||||
#endif
|
||||
|
||||
@@ -70,7 +70,7 @@ static void reboot_to_uf2(void)
|
||||
printk("You can now drag-drop ZephCore firmware UF2.\n");
|
||||
k_msleep(500);
|
||||
|
||||
#if defined(CONFIG_SOC_SERIES_NRF52X) || defined(CONFIG_SOC_SERIES_NRF52)
|
||||
#if defined(CONFIG_SOC_SERIES_NRF52)
|
||||
nrf_power_gpregret_set(NRF_POWER, 0, BOOTLOADER_DFU_UF2_MAGIC);
|
||||
#endif
|
||||
sys_reboot(SYS_REBOOT_COLD);
|
||||
|
||||
Reference in New Issue
Block a user