RF-Positioning-System V0.1
by Max Heinekamp
Loading...
Searching...
No Matches
flash.cpp
Go to the documentation of this file.
1
12
13#include "flash.h"
14
15FLASH::FLASH() : preferences() {
16}
17
19 preferences.begin("config", false);
20 if(!preferences.getBool("initialized", false)) {
21 preferences.putBool("initialized", true);
22
23 // Set default values for SCPI settings
24 preferences.putInt("SCPI-PORT", SCPI_PORT);
25 preferences.putString("IP-ADDRESS", IP_ADDRESS);
26 const byte mac[] = MAC_ADDRESS;
27 preferences.putBytes("MAC-ADDRESS", mac, 6);
28
29 // Set default values for Ethernet settings
30 preferences.putInt("ETHERNET-RESET-PIN", ETHERNET_RESET_PIN);
31
32 // Set default values for stepper settings
33 preferences.putInt("STEPS-PER-REV", STEPS_PER_REV);
34 preferences.putInt("MOTOR1-STEP-PIN", MOTOR1_STEP_PIN);
35 preferences.putInt("MOTOR1-ENABLE-PIN", MOTOR1_ENABLE_PIN);
36 preferences.putInt("MOTOR2-STEP-PIN", MOTOR2_STEP_PIN);
37 preferences.putInt("MOTOR2-ENABLE-PIN", MOTOR2_ENABLE_PIN);
38 preferences.putFloat("R-SENSE", R_SENSE);
39 preferences.putInt("STEP-DELAY", STEP_DELAY);
40 preferences.putInt("RMS-CURRENT", RMS_CURRENT);
41 preferences.putInt("HOLD-CURRENT", HOLD_CURRENT);
42 preferences.putInt("MICROSTEPS", MICROSTEPS);
43 preferences.putInt("STEPPER1-ADDRESS", STEPPER1_ADDRESS);
44 preferences.putInt("STEPPER2-ADDRESS", STEPPER2_ADDRESS);
45 preferences.putInt("AXIS1-GEAR-RATIO", AXIS1_GEAR_RATIO);
46 preferences.putInt("AXIS2-GEAR-RATIO", AXIS2_GEAR_RATIO);
47 preferences.putFloat("AXIS2-DIR-CHANGE-CAL-FACTOR", AXIS2_DIR_CHANGE_CAL_FACTOR);
48 preferences.putInt("SPEED", SPEED);
49 preferences.putInt("ACCELERATION", ACCELERATION);
50 }
51}
FLASH()
Construct a new FLASH object.
Definition flash.cpp:15
void initFlashMemory()
Initialize the flash memory and set default values if not already set.
Definition flash.cpp:18
Handles the flash memory for the ESP32.