more prompt goodness

This commit is contained in:
Morgan 'ARR\!' Allen 2020-04-24 22:47:26 -07:00
parent 164694ff7e
commit 417f7856eb
2 changed files with 9 additions and 3 deletions

View file

@ -61,7 +61,12 @@ void console_task(void *args) {
char *prompt; char *prompt;
while(true) { while(true) {
asprintf(&prompt, LOG_COLOR_I "%s > " LOG_RESET_COLOR, lorcomm_cfg.hostname); asprintf(&prompt, LOG_COLOR_I "%s bw: %d sf: %d cr: %d> " LOG_RESET_COLOR,
lorcomm_cfg.hostname,
lora.bandwidth,
lora.spreadingFactor,
lora.codingRate
);
char* line = linenoise(prompt); char* line = linenoise(prompt);

View file

@ -62,8 +62,8 @@ void app_main(void) {
//lora.bandwidth = B208; //lora.bandwidth = B208;
//lora.codingRate = 5; //lora.codingRate = 5;
lora.frequency = 915000000; lora.frequency = 915000000;
//lora.spreadingFactor = 8; lora.spreadingFactor = 11;
//lora.preamble = DEFAULT_PREAMBLE; lora.preamble = DEFAULT_PREAMBLE;
lora.dio0 = CONFIG_LORA32_DIO0_PIN; lora.dio0 = CONFIG_LORA32_DIO0_PIN;
lora.implicitHeader = false; lora.implicitHeader = false;
lora.nss = CONFIG_LORA32_NSS_PIN; lora.nss = CONFIG_LORA32_NSS_PIN;
@ -76,6 +76,7 @@ void app_main(void) {
//lora.cad_detected = &handle_lora_caddetected; //lora.cad_detected = &handle_lora_caddetected;
lora32_init(&lora); lora32_init(&lora);
lora32_set_spreadfactor(&lora, lora.spreadingFactor);
//double dr = lora32_calc_datarate(&lora); //double dr = lora32_calc_datarate(&lora);
//ESP_LOGI(TAG, "data rate: %fbps", dr); //ESP_LOGI(TAG, "data rate: %fbps", dr);