From 23a3be0341eb1f3dd3211ba55702017edc02fbd5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 6 Jul 2018 22:16:19 -0500 Subject: [PATCH] Fix, style, add Travis test, etc. --- .travis.yml | 1 + Marlin/src/HAL/HAL_ESP32/HAL.cpp | 2 +- Marlin/src/HAL/HAL_ESP32/HAL.h | 5 +- Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp | 208 ++++++------------ Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h | 15 +- Marlin/src/HAL/HAL_ESP32/web.cpp | 24 +- Marlin/src/HAL/HAL_ESP32/web.h | 6 +- Marlin/src/HAL/HAL_ESP32/wifi.cpp | 16 +- Marlin/src/HAL/HAL_ESP32/wifi.h | 12 +- .../src/HAL/HAL_LINUX/hardware/LinearAxis.cpp | 2 +- Marlin/src/inc/SanityCheck.h | 2 +- buildroot/share/tests/esp32-tests | 19 ++ data/www/marlin.css | 105 ++++----- platformio.ini | 15 +- 14 files changed, 170 insertions(+), 262 deletions(-) create mode 100755 buildroot/share/tests/esp32-tests diff --git a/.travis.yml b/.travis.yml index 5b22fc2b3cf4..dec966c92355 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,7 @@ env: #- TEST_PLATFORM="STM32F1" - TEST_PLATFORM="teensy35" - TEST_PLATFORM="linux_native" + - TEST_PLATFORM="esp32" addons: apt: diff --git a/Marlin/src/HAL/HAL_ESP32/HAL.cpp b/Marlin/src/HAL/HAL_ESP32/HAL.cpp index 20c5baf2967d..76b961b7b9f7 100644 --- a/Marlin/src/HAL/HAL_ESP32/HAL.cpp +++ b/Marlin/src/HAL/HAL_ESP32/HAL.cpp @@ -30,11 +30,11 @@ #include #include #include -#include "ESPAsyncWebServer.h" #include "../../inc/MarlinConfigPre.h" #if ENABLED(WIFISUPPORT) + #include #include "wifi.h" #if ENABLED(OTASUPPORT) #include "ota.h" diff --git a/Marlin/src/HAL/HAL_ESP32/HAL.h b/Marlin/src/HAL/HAL_ESP32/HAL.h index fcf935acc3ec..f13c3798de19 100644 --- a/Marlin/src/HAL/HAL_ESP32/HAL.h +++ b/Marlin/src/HAL/HAL_ESP32/HAL.h @@ -46,11 +46,8 @@ #include "i2s.h" #include "HAL_timers_ESP32.h" -#include "WebSocketSerial.h" - -#include "ESPAsyncWebServer.h" -#include "wifi.h" +#include "WebSocketSerial.h" // -------------------------------------------------------------------------- // Defines diff --git a/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp b/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp index 2167a0463f74..450cf683075a 100644 --- a/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp +++ b/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp @@ -19,13 +19,17 @@ * along with this program. If not, see . * */ - #ifdef ARDUINO_ARCH_ESP32 #include "../../inc/MarlinConfig.h" + +#if ENABLED(WIFISUPPORT) + #include "WebSocketSerial.h" -#include "AsyncTCP.h" -#include "ESPAsyncWebServer.h" +#include "wifi.h" + +#include +#include struct ring_buffer_r { unsigned char buffer[RX_BUFFER_SIZE]; @@ -48,18 +52,15 @@ static bool _written; AsyncWebSocket ws("/ws"); // access at ws://[esp ip]/ws -static void addToBuffer(AwsFrameInfo *info, uint8_t *data, size_t len){ - for(size_t i=0; i < len; i++){ - const ring_buffer_pos_t t = rx_buffer.tail; - ring_buffer_pos_t h = rx_buffer.head; +FORCE_INLINE int next_rx_index(const int i) { return (ring_buffer_pos_t)(i + 1) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); } +FORCE_INLINE int next_tx_index(const int i) { return (ring_buffer_pos_t)(i + 1) & (ring_buffer_pos_t)(TX_BUFFER_SIZE - 1); } - // Get the next element - ring_buffer_pos_t n = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); +static void addToBuffer(uint8_t * const data, const size_t len) { + for (size_t i = 0; i < len; i++) { + ring_buffer_pos_t h = rx_buffer.head; + const ring_buffer_pos_t t = rx_buffer.tail, n = next_rx_index(h); - if(n != t){ - rx_buffer.buffer[h] = data[i]; - h = n; - } + if (n != t) { rx_buffer.buffer[h] = data[i]; h = n; } // TODO: buffer is full, handle? @@ -67,35 +68,28 @@ static void addToBuffer(AwsFrameInfo *info, uint8_t *data, size_t len){ } } -static void onEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len){ - //Handle WebSocket event - if(type == WS_EVT_CONNECT){ - //client connected - client->ping(); - } else if(type == WS_EVT_DISCONNECT){ - //client disconnected - } else if(type == WS_EVT_ERROR){ - //error was received from the other end - } else if(type == WS_EVT_PONG){ - //pong message was received (in response to a ping request maybe) - } else if(type == WS_EVT_DATA){ - //data packet - AwsFrameInfo * info = (AwsFrameInfo*)arg; - if (info->opcode == WS_TEXT || info->message_opcode == WS_TEXT) { - addToBuffer(info, data, len); +// Handle WebSocket event +static void onEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len) { + switch (type) { + case WS_EVT_CONNECT: client->ping(); break; // client connected + case WS_EVT_DISCONNECT: // client disconnected + case WS_EVT_ERROR: // error was received from the other end + case WS_EVT_PONG: break; // pong message was received (in response to a ping request maybe) + case WS_EVT_DATA: { // data packet + AwsFrameInfo * info = (AwsFrameInfo*)arg; + if (info->opcode == WS_TEXT || info->message_opcode == WS_TEXT) + addToBuffer(data, len); } } } // Public Methods void WebSocketSerial::begin(const long baud_setting) { - // attach AsyncWebSocket ws.onEvent(onEvent); - server.addHandler(&ws); + server.addHandler(&ws); // attach AsyncWebSocket } -void WebSocketSerial::end() { -} +void WebSocketSerial::end() { } int WebSocketSerial::peek(void) { const int v = rx_buffer.head == rx_buffer.tail ? -1 : rx_buffer.buffer[rx_buffer.tail]; @@ -103,18 +97,12 @@ int WebSocketSerial::peek(void) { } int WebSocketSerial::read(void) { - const ring_buffer_pos_t h = rx_buffer.head; - ring_buffer_pos_t t = rx_buffer.tail; - - // If nothing to read, return now - if (h == t) return -1; - - int v = rx_buffer.buffer[t]; + const ring_buffer_pos_t h = rx_buffer.head, t = rx_buffer.tail; + if (h == t) return -1; // Nothing to read? Return now - t = (ring_buffer_pos_t)(t + 1) & (RX_BUFFER_SIZE - 1); + const int v = rx_buffer.buffer[t]; - // Advance tail - rx_buffer.tail = t; + rx_buffer.tail = (ring_buffer_pos_t)(t + 1) & (RX_BUFFER_SIZE - 1); // Advance tail return v; } @@ -129,7 +117,8 @@ void WebSocketSerial::flush(void) { rx_buffer.tail = rx_buffer.head; } -// #if TX_BUFFER_SIZE > 0 +#if TX_BUFFER_SIZE + void WebSocketSerial::write(const uint8_t c) { _written = true; @@ -147,48 +136,29 @@ void WebSocketSerial::flush(void) { void WebSocketSerial::flushTx(void) { ws.textAll("flushTx"); - if (!_written) { - return; - } + if (!_written) return; } -// #else -// void WebSocketSerial::write(const uint8_t c) { -// _written = true; -// } - -// void WebSocketSerial::flushTx(void) { -// if (!_written) return; -// } -// #endif - -/** -* Imports from print.h -*/ -void WebSocketSerial::print(char c, int base) { - print((long)c, base); -} +#else -void WebSocketSerial::print(unsigned char b, int base) { - print((unsigned long)b, base); -} + //void WebSocketSerial::write(const uint8_t c) { _written = true; } + //void WebSocketSerial::flushTx(void) { if (!_written) return; } -void WebSocketSerial::print(int n, int base) { - print((long)n, base); -} +#endif -void WebSocketSerial::print(unsigned int n, int base) { - print((unsigned long)n, base); -} +/** + * Imports from print.h + */ +void WebSocketSerial::print(char c, int base) { print((long)c, base); } +void WebSocketSerial::print(unsigned char b, int base) { print((unsigned long)b, base); } +void WebSocketSerial::print(int n, int base) { print((long)n, base); } +void WebSocketSerial::print(unsigned int n, int base) { print((unsigned long)n, base); } void WebSocketSerial::print(long n, int base) { if (base == 0) write(n); else if (base == 10) { - if (n < 0) { - print('-'); - n = -n; - } + if (n < 0) { print('-'); n = -n; } printNumber(n, 10); } else @@ -196,63 +166,21 @@ void WebSocketSerial::print(long n, int base) { } void WebSocketSerial::print(unsigned long n, int base) { - if (base == 0) write(n); - else printNumber(n, base); + if (base == 0) write(n); else printNumber(n, base); } -void WebSocketSerial::print(double n, int digits) { - printFloat(n, digits); -} - -void WebSocketSerial::println(void) { - print('\r'); - print('\n'); -} - -void WebSocketSerial::println(const String& s) { - print(s); - println(); -} - -void WebSocketSerial::println(const char c[]) { - print(c); - println(); -} - -void WebSocketSerial::println(char c, int base) { - print(c, base); - println(); -} +void WebSocketSerial::print(double n, int digits) { printFloat(n, digits); } -void WebSocketSerial::println(unsigned char b, int base) { - print(b, base); - println(); -} - -void WebSocketSerial::println(int n, int base) { - print(n, base); - println(); -} - -void WebSocketSerial::println(unsigned int n, int base) { - print(n, base); - println(); -} - -void WebSocketSerial::println(long n, int base) { - print(n, base); - println(); -} - -void WebSocketSerial::println(unsigned long n, int base) { - print(n, base); - println(); -} - -void WebSocketSerial::println(double n, int digits) { - print(n, digits); - println(); -} +void WebSocketSerial::println(void) { print('\r'); print('\n'); } +void WebSocketSerial::println(const String& s) { print(s); println(); } +void WebSocketSerial::println(const char c[]) { print(c); println(); } +void WebSocketSerial::println(char c, int base) { print(c, base); println(); } +void WebSocketSerial::println(unsigned char b, int base) { print(b, base); println(); } +void WebSocketSerial::println(int n, int base) { print(n, base); println(); } +void WebSocketSerial::println(unsigned int n, int base) { print(n, base); println(); } +void WebSocketSerial::println(long n, int base) { print(n, base); println(); } +void WebSocketSerial::println(unsigned long n, int base) { print(n, base); println(); } +void WebSocketSerial::println(double n, int digits) { print(n, digits); println(); } // Private Methods @@ -273,34 +201,32 @@ void WebSocketSerial::printNumber(unsigned long n, uint8_t base) { void WebSocketSerial::printFloat(double number, uint8_t digits) { // Handle negative numbers - if (number < 0.0) { - print('-'); - number = -number; - } + if (number < 0.0) { print('-'); number = -number; } // Round correctly so that print(1.999, 2) prints as "2.00" - double rounding = 0.5; - for (uint8_t i = 0; i < digits; ++i) - rounding *= 0.1; + // Use a lookup table for performance + constexpr double rounds[] = { 0.5, 0.05, 0.005, 0.0005, 0.00005, 0.000005, 0.0000005, 0.00000005 }; + number += rounds[digits]; - number += rounding; + //number += pow(10, -(digits + 1)); // slower single-line equivalent // Extract the integer part of the number and print it unsigned long int_part = (unsigned long)number; - double remainder = number - (double)int_part; print(int_part); // Print the decimal point, but only if there are digits beyond + double remainder = number - (double)int_part; if (digits) { print('.'); // Extract digits from the remainder one at a time while (digits--) { remainder *= 10.0; - int toPrint = int(remainder); + const int toPrint = int(remainder); print(toPrint); remainder -= toPrint; } } } -#endif // ARDUINO_ARCH_ESP32 \ No newline at end of file +#endif // WIFISUPPORT +#endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h b/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h index c6a66b54a903..43c804410700 100644 --- a/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h +++ b/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h @@ -19,9 +19,7 @@ * along with this program. If not, see . * */ - -#ifndef WEBSOCKET_SERIAL_H -#define WEBSOCKET_SERIAL_H +#pragma once #include "../../inc/MarlinConfig.h" @@ -38,6 +36,9 @@ #ifndef TX_BUFFER_SIZE #define TX_BUFFER_SIZE 32 #endif +#if TX_BUFFER_SIZE <= 0 + #error "TX_BUFFER_SIZE is required for the WebSocket." +#endif #if RX_BUFFER_SIZE > 256 typedef uint16_t ring_buffer_pos_t; @@ -45,9 +46,7 @@ typedef uint8_t ring_buffer_pos_t; #endif - class WebSocketSerial { - public: WebSocketSerial() {}; static void begin(const long); @@ -60,11 +59,11 @@ class WebSocketSerial { static void write(const uint8_t c); #if ENABLED(SERIAL_STATS_DROPPED_RX) - FORCE_INLINE static uint32_t dropped() { return 0; } + FORCE_INLINE static uint32_t dropped() { return 0; } #endif #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - FORCE_INLINE static int rxMaxEnqueued() { return 0; } + FORCE_INLINE static int rxMaxEnqueued() { return 0; } #endif FORCE_INLINE static void write(const char* str) { while (*str) write(*str++); } @@ -98,5 +97,3 @@ class WebSocketSerial { }; extern WebSocketSerial webSocketSerial; - -#endif // WEBSOCKET_SERIAL_H diff --git a/Marlin/src/HAL/HAL_ESP32/web.cpp b/Marlin/src/HAL/HAL_ESP32/web.cpp index 13de52366789..a3a6cce729bc 100644 --- a/Marlin/src/HAL/HAL_ESP32/web.cpp +++ b/Marlin/src/HAL/HAL_ESP32/web.cpp @@ -19,13 +19,14 @@ #ifdef ARDUINO_ARCH_ESP32 -#include "FS.h" -#include "SPIFFS.h" - #include "../../inc/MarlinConfigPre.h" #if ENABLED(WEBSUPPORT) +#include "../../core/serial.h" + +#include "FS.h" +#include "SPIFFS.h" #include "wifi.h" AsyncEventSource events("/events"); // event source (Server-Sent events) @@ -35,19 +36,14 @@ void onNotFound(AsyncWebServerRequest *request){ } void web_init() { - // attach AsyncEventSource - server.addHandler(&events); - - Serial.begin(BAUDRATE); - if(!SPIFFS.begin()){ - Serial.println("SPIFFS Mount Failed"); - return; + server.addHandler(&events); // attach AsyncEventSource + if (SPIFFS.begin()) { + server.serveStatic("/", SPIFFS, "/www").setDefaultFile("index.html"); + server.onNotFound(onNotFound); } - - server.serveStatic("/", SPIFFS, "/www").setDefaultFile("index.html"); - server.onNotFound(onNotFound); + else + SERIAL_ECHO_MSG("SPIFFS Mount Failed"); } #endif // WEBSUPPORT - #endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin/src/HAL/HAL_ESP32/web.h b/Marlin/src/HAL/HAL_ESP32/web.h index c3915d3c8b01..7f8796e7d494 100644 --- a/Marlin/src/HAL/HAL_ESP32/web.h +++ b/Marlin/src/HAL/HAL_ESP32/web.h @@ -16,10 +16,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - -#ifndef _HAL_WEB_H -#define _HAL_WEB_H +#pragma once void web_init(); - -#endif diff --git a/Marlin/src/HAL/HAL_ESP32/wifi.cpp b/Marlin/src/HAL/HAL_ESP32/wifi.cpp index 6fb1aeabb165..7afc7a87a85a 100644 --- a/Marlin/src/HAL/HAL_ESP32/wifi.cpp +++ b/Marlin/src/HAL/HAL_ESP32/wifi.cpp @@ -25,11 +25,15 @@ #include #include -#include "ESPAsyncWebServer.h" +#include #include "wifi.h" AsyncWebServer server(80); +#ifndef WIFI_HOSTNAME + #define WIFI_HOSTNAME DEFAULT_WIFI_HOSTNAME +#endif + void wifi_init() { WiFi.mode(WIFI_STA); WiFi.begin(WIFI_SSID, WIFI_PWD); @@ -40,14 +44,12 @@ void wifi_init() { } delay(10); - if (!MDNS.begin(HOSTNAME)){ - while(1){ - delay(5000); - } - } + + // Loop forever (watchdog kill) on failure + if (!MDNS.begin(WIFI_HOSTNAME)) for(;;) delay(5000); + MDNS.addService("http", "tcp", 80); } #endif // WIFISUPPORT - #endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin/src/HAL/HAL_ESP32/wifi.h b/Marlin/src/HAL/HAL_ESP32/wifi.h index c409fec2f098..ef35cf14cab5 100644 --- a/Marlin/src/HAL/HAL_ESP32/wifi.h +++ b/Marlin/src/HAL/HAL_ESP32/wifi.h @@ -16,18 +16,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ +#pragma once -#ifndef _HAL_WIFI_H -#define _HAL_WIFI_H - -#include "ESPAsyncWebServer.h" +#include extern AsyncWebServer server; -#ifndef HOSTNAME - #define HOSTNAME "marlin" -#endif +#define DEFAULT_WIFI_HOSTNAME "marlin" void wifi_init(); - -#endif diff --git a/Marlin/src/HAL/HAL_LINUX/hardware/LinearAxis.cpp b/Marlin/src/HAL/HAL_LINUX/hardware/LinearAxis.cpp index 2682f8be0c54..c50390d7369a 100644 --- a/Marlin/src/HAL/HAL_LINUX/hardware/LinearAxis.cpp +++ b/Marlin/src/HAL/HAL_LINUX/hardware/LinearAxis.cpp @@ -58,7 +58,7 @@ void LinearAxis::interrupt(GpioEvent ev) { position += -1 + 2 * Gpio::pin_map[dir_pin].value; Gpio::pin_map[min_pin].value = (position < min_position); //Gpio::pin_map[max_pin].value = (position > max_position); - //if(position < min_position) printf("axis(%d) endstop : pos: %d, mm: %f, min: %d\n", step_pin, position, position / 80.0, Gpio::pin_map[min_pin].value); + //if (position < min_position) printf("axis(%d) endstop : pos: %d, mm: %f, min: %d\n", step_pin, position, position / 80.0, Gpio::pin_map[min_pin].value); } } } diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 8d4737bacbc4..a2088d23c4ba 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -391,7 +391,7 @@ #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE)) #error "RX_BUFFER_SIZE must be a power of 2 greater than 1." #elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE)) - #error "TX_BUFFER_SIZE must be 0, a power of 2 greater than 1, and no greater than 256." + #error "TX_BUFFER_SIZE must be 0 or a power of 2 between 1 and 256." #endif #elif ENABLED(SERIAL_XON_XOFF) || ENABLED(SERIAL_STATS_MAX_RX_QUEUED) || ENABLED(SERIAL_STATS_DROPPED_RX) #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices." diff --git a/buildroot/share/tests/esp32-tests b/buildroot/share/tests/esp32-tests new file mode 100755 index 000000000000..30c1aa6e40ea --- /dev/null +++ b/buildroot/share/tests/esp32-tests @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# +# Build tests for esp32 +# + +# exit on first failure +set -e + +restore_configs +opt_set MOTHERBOARD BOARD_ESP32 +opt_enable WIFISUPPORT +opt_set "WIFI_SSID \"ssid\"" +opt_set "WIFI_PWD \"password\"" +opt_set TX_BUFFER_SIZE 64 +opt_add WEBSUPPORT +exec_test $1 $2 "ESP32 with WIFISUPPORT and WEBSUPPORT" + +# cleanup +restore_configs diff --git a/data/www/marlin.css b/data/www/marlin.css index aa4467a71a88..b29ec2e24c13 100644 --- a/data/www/marlin.css +++ b/data/www/marlin.css @@ -9,68 +9,57 @@ b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; vertical-align: baseline; font-family: Impact, Charcoal, sans-serif; -} -article, aside, details, figcaption, figure, + } +article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { - display: block; -} -body { - line-height: 1; -} -ol, ul { - list-style: none; -} -blockquote, q { - quotes: none; -} + display: block; + } +body { line-height: 1; } +ol, ul { list-style: none; } +blockquote, q { quotes: none; } blockquote:before, blockquote:after, -q:before, q:after { - content: ''; - content: none; -} +q:before, q:after { content: ''; content: none; } table { - border-collapse: collapse; - border-spacing: 0; -} + border-collapse: collapse; + border-spacing: 0; + } /* Custom */ /* Tabs */ -* { - box-sizing: border-box; -} +* { box-sizing: border-box; } body { display: flex; justify-content: center; padding: 0px; background: #1e1e1e; color: #efefef; -} + } h1 { margin: 0; font-size: 2em; -} + } .tabs { display: flex; width: 100%; flex-wrap: wrap; background: #e5e5e5; -} + } .input { position: absolute; opacity: 0; -} + } .label { width: 100%; padding: 18px 28px; @@ -83,64 +72,58 @@ h1 { border-style: solid; border-width: 0 0 4px 0; border-color: #acacac; -} + } .label:hover { background: #d8d8d8; -} + } .label:active { background: #ccc; -} + } .input:focus + .label { z-index: 1; -} + } .input:checked + .label { background: #1e1e1e; color: #efefef; border-width: 4px 0 0 0; border-color: #65a57d; -} -@media (min-width: 600px) { - .label { - width: auto; } -} .panel { display: none; width: 100%; padding: 20px 30px 30px; background: #1e1e1e; color: #e5e5e5; -} + } .panel .panel-content { width: 100%; max-width: 800px; -} -@media (min-width: 600px) { - .panel { - order: 99; } -} -.input:checked + .label + .panel { - display: block; + +@media (min-width: 600px) { + .label { width: auto; } + .panel { order: 99; } } +.input:checked + .label + .panel { display: block; } + #logo { width: 130px; height: 58px; margin-right: 20px; background: url(marlin-logo.png) no-repeat center center; -} + } input[type="text"], textarea { background-color: #2c2c2c; border: solid 2px #314b3b; color: #e5e5e5; outline: none; -} + } input[type="text"]:focus, textarea:focus { border-color: #4d7a5e; -} + } ul#serial-output { width: 100%; @@ -148,36 +131,36 @@ ul#serial-output { overflow-y: scroll; background-color: #2c2c2c; border: solid 2px #314b3b; -} + } ul#serial-output li { padding: 4px; font-family: "Lucida Console", Monaco, monospace; font-size: 0.8em; -} + } ul#serial-output li:nth-child(odd) { background-color: #3c3c3c; -} + } div.form-wrapper { display: flex; width: 100%; margin: 6px 0; -} + } div.form-wrapper input { font-size: 1.2em; padding: 4px 6px; -} + } div.form-wrapper input[type="text"] { flex: 1 1 auto; -} + } div.form-wrapper input[type="submit"], div.form-wrapper button { border: solid 2px #314b3b; background-color: #4d7a5e; color: #e5e5e5; -} \ No newline at end of file + } diff --git a/platformio.ini b/platformio.ini index 886f0c31229d..6ca0fe71250e 100644 --- a/platformio.ini +++ b/platformio.ini @@ -286,7 +286,7 @@ src_filter = ${common.default_src_filter} + monitor_speed = 250000 # -# ARMED +# ARMED (STM32) # [env:ARMED] platform = ststm32 @@ -331,6 +331,9 @@ lib_ignore = Adafruit NeoPixel src_filter = ${common.default_src_filter} + monitor_speed = 250000 +# +# Malyan M200 (STM32F1) +# [env:malyanm200] platform = ststm32 framework = arduino @@ -358,10 +361,8 @@ lib_ignore = platform = https://github.com/platformio/platform-espressif32.git ; #feature/stage board = esp32dev framework = arduino -upload_speed = 921600 -monitor_speed = 921600 -data_dir = ./data -; upload_port = COM3 +upload_speed = 115200 +monitor_speed = 115200 upload_port = /dev/ttyUSB0 lib_deps = https://github.com/me-no-dev/AsyncTCP.git @@ -376,10 +377,6 @@ lib_ignore = SailfishLCD SailfishRGB_LED src_filter = ${common.default_src_filter} + -targets = - upload - buildfs - uploadfs # # FYSETC F6 V1.3