diff --git a/SCPI_manual/smartpower3_scpi_manual.pdf b/SCPI_manual/smartpower3_scpi_manual.pdf index 3efbd3d..ece7272 100644 Binary files a/SCPI_manual/smartpower3_scpi_manual.pdf and b/SCPI_manual/smartpower3_scpi_manual.pdf differ diff --git a/SCPI_manual/smartpower3_scpi_manual.tex b/SCPI_manual/smartpower3_scpi_manual.tex index ed11d81..965c573 100644 --- a/SCPI_manual/smartpower3_scpi_manual.tex +++ b/SCPI_manual/smartpower3_scpi_manual.tex @@ -1,6 +1,5 @@ \documentclass[a4paper,10pt]{article} \usepackage[left=2.5cm,right=2.5cm,top=2cm]{geometry} -%\usepackage[T1]{fontenc} \usepackage{fontenc} \usepackage{lmodern} \usepackage[utf8]{inputenc} @@ -17,8 +16,6 @@ \usepackage{textcomp} \usepackage{listings} \usepackage{hyperref} -%\usepackage{glossaries} -%\usepackage{parskip} \title{Hardkernel SmartPower3 SCPI manual} \author{Lukáš Říha} @@ -343,9 +340,6 @@ \section{Commands} \begin{description} This query returns the output states of channel \verb!#!. Returns 0 or 1. \end{description} - - %/*{ "SYSTem:COMMunication:TCPIP:CONTROL?", SCPI_SystemCommTcpipControlQ, 0 },*/ - \end{enumerate} \end{enumerate} diff --git a/smartpower3/component.h b/smartpower3/component.h index 8232cc7..3ffbf64 100644 --- a/smartpower3/component.h +++ b/smartpower3/component.h @@ -46,7 +46,6 @@ class Component void setTextColor(uint16_t fg_color, uint16_t bg_color); void loadFont(const uint8_t font[]); void unloadFont(void); - //void clearAndDrawWithFont(const uint8_t font[], String string_to_draw); void clearAndDrawWithColoredFont(const uint8_t font[], uint16_t fg_color, const char* string_to_draw); void clearAndDrawWithFont(const uint8_t font[], const char* string_to_draw); private: diff --git a/smartpower3/inputmanager.h b/smartpower3/inputmanager.h index 596a28d..ee99794 100644 --- a/smartpower3/inputmanager.h +++ b/smartpower3/inputmanager.h @@ -1,6 +1,6 @@ #include #include -//#include + #define DEBOUNCE_TIME 100 #define LONG_PRESS_TIME 3000 @@ -8,7 +8,6 @@ void countEncoder(void *val); void initEncoder(void *param); - struct dial_t { int8_t cnt; int8_t direct; diff --git a/smartpower3/meas_channel.cpp b/smartpower3/meas_channel.cpp index ce4a682..fa56651 100644 --- a/smartpower3/meas_channel.cpp +++ b/smartpower3/meas_channel.cpp @@ -81,11 +81,6 @@ void MeasChannels::sample() A = A * 100 / 65536; A = A / rsense * 1000000; -/* Serial.printf("%6.10f\n\r", V); - Serial.printf("%6.10f\n\r", A); - Serial.printf("%d\n\r", static_cast(V)); - Serial.printf("%d\n\r", static_cast(A));*/ - switch (i) { case 0: channel0->update(V, A); diff --git a/smartpower3/scpimanager.cpp b/smartpower3/scpimanager.cpp index aafd4ff..b809bf3 100644 --- a/smartpower3/scpimanager.cpp +++ b/smartpower3/scpimanager.cpp @@ -264,9 +264,7 @@ scpi_result_t SCPIManager::DMM_MeasureUnitDcQ(scpi_t *context, scpi_unit_t allow { const uint8_t max_param_count = 3; UserContext *user_ctx = static_cast(context->user_context); - //Settings *settings = user_ctx->settings; MeasChannels *channels = user_ctx->measuring_channels; - //ScreenManager *sm = user_ctx->screen_manager; scpi_number_t expected_value; scpi_number_t resolution; scpi_parameter_t working_param; diff --git a/smartpower3/scpimanager.h b/smartpower3/scpimanager.h index 6bf0675..4227aaa 100644 --- a/smartpower3/scpimanager.h +++ b/smartpower3/scpimanager.h @@ -134,7 +134,6 @@ class SCPIManager { "*OPC", SCPI_CoreOpc, 0 }, { "*OPC?", SCPI_CoreOpcQ, 0 }, //TODO: Check if reset is complete or needs rework - //{ "*RST", SCPI_CoreRst, 0 }, { "*RST", Reset, 0 }, { "*SRE", SCPI_CoreSre, 0 }, { "*SRE?", SCPI_CoreSreQ, 0 }, @@ -163,7 +162,7 @@ class SCPIManager {"SYSTem:COMMunicate:NETwork:GATE?", SCPI_NetworkGateQ, 0 }, // This command sets the Gateway IP address of the Ethernet module of the power supply. // The Gateway IP defaults to 0.0.0.0 in absence of a DHCP server. - // Gateway IP address is represented with 4 bytes each having a range of 0-255 separated by dots + // Gateway IP address is represented with 4 bytes each having a range of 0-255 separated by dots {"SYSTem:COMMunicate:NETwork:SUBNet", SCPI_NetworkSubnet, 0 }, {"SYSTem:COMMunicate:NETwork:SUBNet?", SCPI_NetworkSubnetQ, 0 }, // This command sets the subnet IP Mask address of the Ethernet module of the power supply. @@ -195,12 +194,6 @@ class SCPIManager {"SYSTem:COMMunicate:Serial:FEED", SCPI_SerialFeed, 0}, {"SYSTem:COMMunicate:Serial:FEED?", SCPI_SerialFeedQ, 0}, - //{"[SYSTem][:COMMunicate]:SERial:FEED", SCPI_SocketPortQ, 0 } - //{"[SYSTem][:COMMunicate]:SERial:FEED?", SCPI_SocketPortQ, 0 } - //{"[SYSTem][:COMMunicate]:SOCKet:FEED", SCPI_SocketPort, 0 }, - //{"[SYSTem][:COMMunicate]:SOCKet:FEED?", SCPI_SocketPortQ, 0 }, - - //{"STATus:OPERation?", scpi_stub_callback, 0}, //{"STATus:OPERation:EVENt?", scpi_stub_callback, 0}, //{"STATus:OPERation:CONDition?", scpi_stub_callback, 0}, @@ -227,8 +220,6 @@ class SCPIManager { "OUTPut#[:STATe]", Output_TurnOnOff, 0 }, { "OUTPut#[:STATe]?", Output_TurnOnOffQ, 0 }, - /*{ "SYSTem:COMMunication:TCPIP:CONTROL?", SCPI_SystemCommTcpipControlQ, 0 },*/ - SCPI_CMD_LIST_END }; }; diff --git a/smartpower3/screenmanager.h b/smartpower3/screenmanager.h index 9418510..7636b57 100644 --- a/smartpower3/screenmanager.h +++ b/smartpower3/screenmanager.h @@ -73,5 +73,3 @@ class ScreenManager Screen *screens[LAST_SCREEN_COUNT] = {}; bool show_next_screen = false; }; - -//ScreenManager screen_manager; diff --git a/smartpower3/screens/networkscreen.h b/smartpower3/screens/networkscreen.h index e985cd5..c2bfad3 100644 --- a/smartpower3/screens/networkscreen.h +++ b/smartpower3/screens/networkscreen.h @@ -23,10 +23,6 @@ enum network_screen_state_setting { STATE_NETWORK_WIFI_ICON = 1, STATE_NETWORK_LOGGING_ICON, STATE_NETWORK_DHCP, -// STATE_NETWORK_MODE, -// STATE_LOG_INTERVAL, -// STATE_BAUD_RATE, -// STATE_BL, }; @@ -51,7 +47,6 @@ class NetworkScreen : public Screen void drawGatewayIpaddr(const char* ipaddr); void drawSubnetMask(const char* ipaddr); void drawDnsServers(const char* ipaddr_dns1, const char* ipaddr_dns2); - //void drawMode(device_operation_mode default_mode = OPERATION_MODE_DEFAULT); void onEnter(void); void debug(void); diff --git a/smartpower3/screens/settingscreen.cpp b/smartpower3/screens/settingscreen.cpp index b3485dc..5b72600 100644 --- a/smartpower3/screens/settingscreen.cpp +++ b/smartpower3/screens/settingscreen.cpp @@ -504,7 +504,6 @@ void SettingScreen::changeOperationMode(device_operation_mode operation_mode) { drawMode(operation_mode); operation_mode_edit = operation_mode; - //changeOperationMode(operation_mode); } void SettingScreen::selectBLLevel(uint16_t rectangle_color) diff --git a/smartpower3/screens/settingscreen.h b/smartpower3/screens/settingscreen.h index 638896b..1fa3f25 100644 --- a/smartpower3/screens/settingscreen.h +++ b/smartpower3/screens/settingscreen.h @@ -27,9 +27,6 @@ #define X_IPADDR 226 #define X_SSID 172 -/*#define LINE_SPACING 42 -#define RIGHT_POSITION_X 460*/ - enum setting_screen_mode_t { SETTING_SETTING = 0, @@ -39,7 +36,6 @@ enum setting_screen_mode_t { SETTING_SETTING_OPERATION_MODE, }; - enum screen_state_setting { STATE_SETTING_WIFI_ICON = 1, STATE_SETTING_LOGGING_ICON, @@ -106,7 +102,6 @@ class SettingScreen : public Screen void drawSerialBaud(uint32_t serial_baud); void drawSerialLoggingEnabled(bool is_enabled=true); void drawWifiLoggingEnabled(bool is_enabled=true); - //void popUp(void); void drawUDPIpaddr(const char* ipaddr); void drawUDPport(uint16_t port); @@ -119,7 +114,6 @@ class SettingScreen : public Screen void debug(void); private: setting_screen_mode_t mode = SETTING_SETTING; - //TFT_eSprite *popup; uint16_t x; uint16_t y; uint8_t backlight_level_preset = 0; @@ -133,7 +127,6 @@ class SettingScreen : public Screen uint32_t serial_baud_edit = 0; device_operation_mode operation_mode; device_operation_mode operation_mode_edit; - //device_operation_mode operation_mode = OPERATION_MODE_DEFAULT; Component *com_serial_baud; Component *com_log_interval; Component *com_ssid; diff --git a/smartpower3/settings.cpp b/smartpower3/settings.cpp index 30b557e..567e73c 100644 --- a/smartpower3/settings.cpp +++ b/smartpower3/settings.cpp @@ -26,20 +26,14 @@ void Settings::init() this->serial_baud_rate = this->getSerialBaudRate(true); // Logging related this->logging_enabled = this->isLoggingEnabled(true); - //this->log_interval_index = this->getLogIntervalIndex(true); this->log_interval = this->getLogInterval(true); this->wifi_ipv4_udp_logging_server_ip_address = this->getWifiIpv4UdpLoggingServerIpAddress(true); this->wifi_ipv4_udp_logging_server_port = this->getWifiIpv4UdpLoggingServerPort(true); // WiFI related this->wifi_enabled = this->isWifiEnabled(true); this->mac_address = this->getMacAddress(); - //this->wifi_use_ipv4 = true; - //bool wifi_use_ipv6 = false; this->wifi_access_point_ssid = this->getWifiAccessPointSsid(true); this->wifi_password = this->getWifiPassword(true); -//TODO: add settings/checking CREDENTIALS_STATE - /*this->wifi_credentials_checked = this->isWifiCredentialsChecked(); - this->wifi_ipv4_connect_automatically = true;*/ this->wifi_ipv4_dhcp_enabled = this->isWifiIpv4DhcpEnabled(true); this->wifi_ipv4_static_ip = this->getWifiIpv4StaticIp(true); this->wifi_ipv4_gateway_address = this->getWifiIpv4GatewayAddress(true); diff --git a/smartpower3/smartpower3.h b/smartpower3/smartpower3.h index 4420274..6b23d6e 100644 --- a/smartpower3/smartpower3.h +++ b/smartpower3/smartpower3.h @@ -1,6 +1,5 @@ #include #include -//#include #include "inputmanager.h" #include "settings.h" #include "wifimanager.h" @@ -44,5 +43,3 @@ TaskHandle_t screen_handle; TaskHandle_t input_handle; TaskHandle_t button_handle; TaskHandle_t log_handle; -//TaskHandle_t encoder_handle; - diff --git a/smartpower3/smartpower3.ino b/smartpower3/smartpower3.ino index ef5a7fd..463b456 100644 --- a/smartpower3/smartpower3.ino +++ b/smartpower3/smartpower3.ino @@ -299,13 +299,11 @@ void loop() { screen_manager.dimmingLED(1); } #ifdef TASK_STACK_HIGH_WATERMARK_SERIAL_PRINT - //Serial.printf("Loop: %u\n\r", uxTaskGetStackHighWaterMark(NULL)); Serial.printf("WiFi task: %u\n\r", uxTaskGetStackHighWaterMark(wifi_handle)); Serial.printf("Screen task: %u\n\r", uxTaskGetStackHighWaterMark(screen_handle)); Serial.printf("Button task: %u\n\r", uxTaskGetStackHighWaterMark(button_handle)); Serial.printf("Input task: %u\n\r", uxTaskGetStackHighWaterMark(input_handle)); Serial.printf("Log task: %u\n\r", uxTaskGetStackHighWaterMark(log_handle)); - //Serial.printf("Encoder task: %u\n\r", uxTaskGetStackHighWaterMark(encoder_handle)); #endif #ifdef HEAP_INFO_SERIAL_PRINT heap_caps_print_heap_info(MALLOC_CAP_8BIT); diff --git a/smartpower3/wifimanager.h b/smartpower3/wifimanager.h index c76a063..d2633b0 100644 --- a/smartpower3/wifimanager.h +++ b/smartpower3/wifimanager.h @@ -50,9 +50,7 @@ class WiFiManager void apDisconnectAndTurnWiFiOff(void); void apInfo(void); String apInfoSaved(void); - //char* apInfoSaved(void); String apInfoConnected(void); - //char apInfoConnected(void); void udpServerInfo(); void udpServerForget(void); void switchWiFiConnection(void);