forked from bdring/FluidNC
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from bdring/main
Update from Main
- Loading branch information
Showing
204 changed files
with
4,748 additions
and
7,658 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: FluidNC Continuous Integration | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- macos-latest | ||
- windows-latest | ||
pio_env: | ||
- noradio | ||
- wifi | ||
- bt | ||
# - wifibt | ||
# - debug | ||
pio_env_variant: | ||
- "" | ||
# - "_s2" | ||
# - "_s3" | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
cache: "pip" | ||
- name: Install PlatformIO | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Cache PlatformIO | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.platformio | ||
key: platformio-${{ runner.os }} | ||
- name: Build target ${{ matrix.pio_env }}${{ matrix.pio_env_variant }} | ||
run: pio run -e ${{ matrix.pio_env }}${{ matrix.pio_env_variant }} | ||
|
||
tests: | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
pio_env: tests | ||
- os: macos-latest | ||
pio_env: tests | ||
- os: windows-latest | ||
pio_env: tests_nosan | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
# Windows has issues running gtest code with the included gcc, so install | ||
# MSYS2 and use that instead (remember to add it to the path) | ||
- if: matrix.os == 'windows-latest' | ||
name: Install MSYS2 (Windows) | ||
uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: UCRT64 | ||
location: D:\ | ||
install: mingw-w64-ucrt-x86_64-gcc | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
cache: "pip" | ||
- name: Install PlatformIO | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Cache PlatformIO | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.platformio | ||
key: platformio-${{ runner.os }} | ||
|
||
# Separate run task for Windows, since it has issues with the included gcc | ||
- if: matrix.os == 'windows-latest' | ||
name: Run tests (Windows) | ||
run: | | ||
$env:PATH = "D:\msys64\mingw64\bin;D:\msys64\usr\bin;D:\msys64\ucrt64\bin;" + $env:PATH | ||
pio test -e ${{ matrix.pio_env }} -vv | ||
- if: matrix.os != 'windows-latest' | ||
name: Run tests | ||
run: pio test -e ${{ matrix.pio_env }} -vv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,4 @@ build/ | |
dist/ | ||
*.cppx | ||
*.hx | ||
/compile_commands.json |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright (c) 2023 - Mitch Bradley | ||
// Use of this source code is governed by a GPLv3 license that can be found in the LICENSE file. | ||
|
||
#include "src/StartupLog.h" | ||
#include "src/Protocol.h" // send_line() | ||
#include <sstream> | ||
|
||
// The startup log is stored in RTC RAM that is preserved across | ||
// resets. That lets us show the previous startup log if the | ||
// system panics and resets. | ||
|
||
// The size is limited by the size of RTC RAM minus system usage thereof | ||
static const size_t _maxlen = 7000; | ||
static RTC_NOINIT_ATTR char _messages[_maxlen]; | ||
static RTC_NOINIT_ATTR size_t _len; | ||
static bool _paniced; | ||
|
||
void StartupLog::init() { | ||
if (esp_reset_reason() == ESP_RST_PANIC) { | ||
_paniced = true; | ||
} else { | ||
_paniced = false; | ||
_len = 0; | ||
} | ||
} | ||
size_t StartupLog::write(uint8_t data) { | ||
if (_paniced || _len >= _maxlen) { | ||
return 0; | ||
} | ||
_messages[_len++] = (char)data; | ||
return 1; | ||
} | ||
void StartupLog::dump(Channel& out) { | ||
if (_paniced) { | ||
log_error_to(out, "Showing startup log from previous panic"); | ||
} | ||
for (size_t i = 0; i < _len;) { | ||
std::string line; | ||
while (i < _len) { | ||
char c = _messages[i++]; | ||
if (c == '\n') { | ||
break; | ||
} | ||
line += c; | ||
} | ||
log_to(out, line); | ||
} | ||
} | ||
|
||
StartupLog::~StartupLog() {} | ||
|
||
StartupLog startupLog; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2022 Mitch Bradley | ||
// Use of this source code is governed by a GPLv3 license that can be found in the LICENSE file. | ||
// | ||
// Noop replacements for ESP-IDF coredump routines. | ||
// This suppresses complaints about not being able to find a coredump partition. | ||
// We don't want to waste space for such a partition, and the Arduino Framework | ||
// enables coredumps. We override that by stubbing out these routines. | ||
|
||
#include <stddef.h> | ||
#include "esp_err.h" | ||
#include "esp_private/panic_internal.h" | ||
#include "esp_core_dump_summary_port.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
void esp_core_dump_init(void) {} | ||
|
||
void esp_core_dump_flash_init(void) {} | ||
void esp_core_dump_to_flash(void* info) {} | ||
|
||
esp_err_t esp_core_dump_image_check(void) { | ||
return ESP_ERR_NOT_FOUND; | ||
} | ||
esp_err_t esp_core_dump_image_get(size_t* out_addr, size_t* out_size) { | ||
return ESP_ERR_NOT_FOUND; | ||
} | ||
esp_err_t esp_core_dump_image_erase(void) { | ||
return ESP_OK; | ||
} | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
Oops, something went wrong.