mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-05-24 13:05:30 +00:00
remove deprecated functions, fix typo and style
This commit is contained in:
@@ -22,7 +22,7 @@ void TechoCardBoard::begin() {
|
||||
NRF52BoardDCDC::begin();
|
||||
Wire.begin();
|
||||
|
||||
for (uint8_t i = 0; i < sizeof(Led) / sizeof(*Led); i++)
|
||||
for (uint8_t i = 0; i < sizeof(Led) / sizeof(Led[0]); i++)
|
||||
{
|
||||
Led[i]->begin();
|
||||
delay(3); // allow the LEDs to initialise, otherwise they can get stuck
|
||||
@@ -88,7 +88,7 @@ void TechoCardBoard::turnOffLeds() {
|
||||
}
|
||||
|
||||
void TechoCardBoard::powerOff() {
|
||||
nrf_gpio_cfg_sense_input(BUTTON_PIN, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);\
|
||||
nrf_gpio_cfg_sense_input(BUTTON_PIN, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);
|
||||
turnOffLeds();
|
||||
digitalWrite(PIN_PWR_EN, LOW);
|
||||
sd_power_system_off();
|
||||
|
||||
@@ -32,24 +32,7 @@ bool radio_init() {
|
||||
return radio.std_init(&SPI);
|
||||
}
|
||||
|
||||
uint32_t radio_get_rng_seed() {
|
||||
return radio.random(0x7FFFFFFF);
|
||||
}
|
||||
|
||||
void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) {
|
||||
radio.setFrequency(freq);
|
||||
radio.setSpreadingFactor(sf);
|
||||
radio.setBandwidth(bw);
|
||||
radio.setCodingRate(cr);
|
||||
}
|
||||
|
||||
void radio_set_tx_power(int8_t dbm) {
|
||||
radio.setOutputPower(dbm);
|
||||
}
|
||||
|
||||
mesh::LocalIdentity radio_new_identity() {
|
||||
RadioNoiseListener rng(radio);
|
||||
return mesh::LocalIdentity(&rng); // create new random identity
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -26,8 +26,4 @@ extern EnvironmentSensorManager sensors;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
uint32_t radio_get_rng_seed();
|
||||
void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr);
|
||||
void radio_set_tx_power(int8_t dbm);
|
||||
mesh::LocalIdentity radio_new_identity();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user