Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
vad7 committed Feb 26, 2023
1 parent e153141 commit e7480de
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nrf24batch.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ uint8_t cmd_array_cnt = 0;
uint8_t save_settings = 0;
uint16_t view_cmd[3] = {0, 0, 0}; // ReadBatch, Read, WriteBatch
uint8_t view_x = 0;
char Info[20] = "";
char Info[32] = "";
char screen_buf[64];
char file_name[32];
char ERR_STR[32];
Expand Down Expand Up @@ -253,7 +253,7 @@ static void prepare_nrf24(void)
nrf24_write_reg(nrf24_HANDLE, REG_RF_CH, NRF_channel);
nrf24_write_reg(nrf24_HANDLE, REG_RF_SETUP, (NRF_rate == 0 ? 0b00100000 : NRF_rate == 1 ? 0 : 0b00001000) | 0b111); // +TX high power
nrf24_write_reg(nrf24_HANDLE, REG_CONFIG, 0x70 | ((NRF_CRC == 1 ? 0b1000 : NRF_CRC == 2 ? 0b1100 : 0))); // Mask all interrupts
nrf24_write_reg(nrf24_HANDLE, REG_SETUP_RETR, ((NRF_rate == 0 ? 0b0010 : 0b0001)<<4) | 0b0111); // Automatic Retransmission, ARD, ARC
nrf24_write_reg(nrf24_HANDLE, REG_SETUP_RETR, ((NRF_rate == 0 ? 0b0100 : 0b0010)<<4) | 0b1111); // Automatic Retransmission, ARD, ARC
nrf24_write_reg(nrf24_HANDLE, REG_EN_AA, 0x01); // Auto acknowledgement
nrf24_write_reg(nrf24_HANDLE, REG_FEATURE, NRF24_EN_DYN_ACK | (NRF_DPL ? 4 : 0)); // Enables the W_TX_PAYLOAD_NOACK command, Disable Payload with ACK, set Dynamic Payload
nrf24_write_reg(nrf24_HANDLE, REG_DYNPD, NRF_DPL ? 0x3F : 0); // Enable dynamic payload reg
Expand Down Expand Up @@ -639,6 +639,7 @@ static uint8_t load_settings_file() {
FURI_LOG_D(TAG, "Loading settings file");
FuriString* str = furi_string_alloc();
free_store();
Info[0] = '\0';
NRF_INITED = false;
while(stream_read_line(file_stream, str)) {
char *p = (char*)furi_string_get_cstr(str);
Expand Down Expand Up @@ -948,7 +949,7 @@ int32_t nrf24batch_app(void* p) {
static FuriLogLevel FuriLogLevel = FuriLogLevelDefault;
if(furi_log_get_level() != FuriLogLevel) {
FuriLogLevel = furi_log_get_level();
if(FuriLogLevel == FuriLogLevelDebug) furi_hal_uart_set_br(FuriHalUartIdUSART1, 460800);
if(FuriLogLevel == FuriLogLevelDebug) furi_hal_uart_set_br(FuriHalUartIdUSART1, 1843200);
}

if(event_status == FuriStatusOk) {
Expand Down

0 comments on commit e7480de

Please sign in to comment.