mirror of
https://github.com/peterantypas/maiana.git
synced 2025-05-15 23:10:11 -07:00
4.4.0
This commit is contained in:
parent
392a99f8d9
commit
3e2ac78844
@ -37,7 +37,8 @@ public:
|
|||||||
bool writeStationData(const StationData &data);
|
bool writeStationData(const StationData &data);
|
||||||
bool readStationData(StationData &data);
|
bool readStationData(StationData &data);
|
||||||
bool isStationDataProvisioned();
|
bool isStationDataProvisioned();
|
||||||
void resetToDefaults();
|
void eraseStationData();
|
||||||
|
|
||||||
void reportStationData();
|
void reportStationData();
|
||||||
void reportOTPData();
|
void reportOTPData();
|
||||||
const OTPData *readOTP();
|
const OTPData *readOTP();
|
||||||
@ -51,6 +52,8 @@ public:
|
|||||||
void setXOTrimValue(uint8_t value);
|
void setXOTrimValue(uint8_t value);
|
||||||
uint8_t getXOTrimValue();
|
uint8_t getXOTrimValue();
|
||||||
void reportXOTrimValue();
|
void reportXOTrimValue();
|
||||||
|
|
||||||
|
void factoryReset();
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Configuration();
|
Configuration();
|
||||||
|
@ -75,6 +75,7 @@ void bsp_erase_config_flags();
|
|||||||
|
|
||||||
void bsp_read_xo_trim(XOTrim *t);
|
void bsp_read_xo_trim(XOTrim *t);
|
||||||
void bsp_write_xo_trim(const XOTrim &t);
|
void bsp_write_xo_trim(const XOTrim &t);
|
||||||
|
void bsp_erase_xo_trim();
|
||||||
|
|
||||||
// Callback for processing UART input (interrupt)
|
// Callback for processing UART input (interrupt)
|
||||||
typedef void(*char_input_cb)(char c);
|
typedef void(*char_input_cb)(char c);
|
||||||
|
@ -132,10 +132,15 @@ void CommandProcessor::processCommand(const char *buff)
|
|||||||
{
|
{
|
||||||
jumpToBootloader();
|
jumpToBootloader();
|
||||||
}
|
}
|
||||||
|
else if ( s.find("erase station") == 0 )
|
||||||
|
{
|
||||||
|
Configuration::instance().eraseStationData();
|
||||||
|
Configuration::instance().reportStationData();
|
||||||
|
}
|
||||||
else if ( s.find("factory reset") == 0 )
|
else if ( s.find("factory reset") == 0 )
|
||||||
{
|
{
|
||||||
// Clear station data
|
Configuration::instance().factoryReset();
|
||||||
Configuration::instance().resetToDefaults();
|
Configuration::instance().reportStationData();
|
||||||
}
|
}
|
||||||
else if ( s.find("tx test") == 0 )
|
else if ( s.find("tx test") == 0 )
|
||||||
{
|
{
|
||||||
|
@ -174,6 +174,11 @@ bool Configuration::isStationDataProvisioned()
|
|||||||
return bsp_is_station_data_provisioned();
|
return bsp_is_station_data_provisioned();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Configuration::eraseStationData()
|
||||||
|
{
|
||||||
|
bsp_erase_station_data();
|
||||||
|
}
|
||||||
|
|
||||||
#if OTP_DATA
|
#if OTP_DATA
|
||||||
void Configuration::reportOTPData()
|
void Configuration::reportOTPData()
|
||||||
{
|
{
|
||||||
@ -214,12 +219,12 @@ void Configuration::reportXOTrimValue()
|
|||||||
EventQueue::instance().push(e);
|
EventQueue::instance().push(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::resetToDefaults()
|
void Configuration::factoryReset()
|
||||||
{
|
{
|
||||||
bsp_erase_station_data();
|
bsp_erase_station_data();
|
||||||
reportStationData();
|
|
||||||
mFlags = {0};
|
mFlags = {0};
|
||||||
bsp_erase_config_flags();
|
bsp_erase_config_flags();
|
||||||
|
bsp_erase_xo_trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Configuration::writeStationData(const StationData &data)
|
bool Configuration::writeStationData(const StationData &data)
|
||||||
|
@ -480,6 +480,12 @@ void bsp_write_xo_trim(const XOTrim &t)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void bsp_erase_xo_trim()
|
||||||
|
{
|
||||||
|
XOTrim t = {0, 0, {0}};
|
||||||
|
bsp_write_xo_trim(t);
|
||||||
|
}
|
||||||
|
|
||||||
void bsp_set_rx_mode()
|
void bsp_set_rx_mode()
|
||||||
{
|
{
|
||||||
HAL_GPIO_WritePin(PA_BIAS_PORT, PA_BIAS_PIN, GPIO_PIN_RESET); // Kill the RF MOSFET bias voltage
|
HAL_GPIO_WritePin(PA_BIAS_PORT, PA_BIAS_PIN, GPIO_PIN_RESET); // Kill the RF MOSFET bias voltage
|
||||||
|
Loading…
x
Reference in New Issue
Block a user