|
|
@@ -14,15 +14,16 @@
|
|
|
#include <u8g2.h>
|
|
|
|
|
|
#define TAG "nrf24batch"
|
|
|
+
|
|
|
#define VERSION "1.9"
|
|
|
|
|
|
-#define SCAN_APP_PATH_FOLDER STORAGE_APP_DATA_PATH_PREFIX
|
|
|
-#define LOG_FILEEXT ".txt"
|
|
|
-#define NRF_READ_TIMEOUT 300UL // ms
|
|
|
-#define WORK_PERIOD 2 // ms, Timer period
|
|
|
-#define MAX_CHANNEL 125
|
|
|
+#define SCAN_APP_PATH_FOLDER STORAGE_APP_DATA_PATH_PREFIX
|
|
|
+#define LOG_FILEEXT ".txt"
|
|
|
+#define NRF_READ_TIMEOUT 300UL // ms
|
|
|
+#define WORK_PERIOD 2 // ms, Timer period
|
|
|
+#define MAX_CHANNEL 125
|
|
|
#define FONT_5x7_SCREEN_WIDTH 25
|
|
|
-#define NRF_EN_DYN_ACK 0 // does not work on some nrf24l01+ chips, (0/1)
|
|
|
+#define NRF_EN_DYN_ACK 0 // does not work on some nrf24l01+ chips, (0/1)
|
|
|
|
|
|
const char SettingsFld_Info[] = "Info:";
|
|
|
const char SettingsFld_Ch[] = "Ch:";
|
|
|
@@ -48,7 +49,7 @@ const char SettingsFld_ReadCmdRepeatPeriod[] = "ReadCmd repeat:";
|
|
|
const char AskQuestion_Save[] = "SAVE BATCH?";
|
|
|
#define Settings_i 'i'
|
|
|
#define Settings_n 'n'
|
|
|
-#define VAR_EMPTY ((int32_t)0x80000000)
|
|
|
+#define VAR_EMPTY ((int32_t)0x80000000)
|
|
|
|
|
|
nRF24Batch* APP;
|
|
|
uint8_t what_doing = 0; // 0 - setup, 1 - cmd list, 2 - read/write/listen cmd
|
|
|
@@ -61,7 +62,14 @@ enum {
|
|
|
rwt_max
|
|
|
};
|
|
|
uint8_t rw_type = rwt_read_batch; // What to do: rwt_*
|
|
|
-enum { sst_none = 0, sst_sending, sst_receiving, sst_ok, sst_error, sst_timeout };
|
|
|
+enum {
|
|
|
+ sst_none = 0,
|
|
|
+ sst_sending,
|
|
|
+ sst_receiving,
|
|
|
+ sst_ok,
|
|
|
+ sst_error,
|
|
|
+ sst_timeout
|
|
|
+};
|
|
|
uint8_t send_status = sst_none; // sst_*
|
|
|
bool cmd_array = false;
|
|
|
uint8_t cmd_array_idx;
|
|
|
@@ -139,7 +147,13 @@ uint16_t pwr_read_timer = 0;
|
|
|
int Current = 0;
|
|
|
int CurrentStart = 0;
|
|
|
|
|
|
-enum { ask_write_batch = 1, ask_save_batch, ask_skip_cmd, ask_return, ask_exit };
|
|
|
+enum {
|
|
|
+ ask_write_batch = 1,
|
|
|
+ ask_save_batch,
|
|
|
+ ask_skip_cmd,
|
|
|
+ ask_return,
|
|
|
+ ask_exit
|
|
|
+};
|
|
|
uint8_t ask_question = 0; // 1 - Ask now - ask_*
|
|
|
uint8_t ask_question_answer = 0; // 0 - no, 1 - yes
|
|
|
|