Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Build Examples
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: v5.2.2
esp_idf_version: release-v5.4
target: esp32s3
path: '.'
29 changes: 24 additions & 5 deletions .github/workflows/package_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,40 @@ on:
branches: [main]
release:
types: [published]
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest
continue-on-error: false

outputs:
zipfile-id: ${{ steps.zip_step.outputs.artifact-id }}

steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'recursive'
uses: actions/checkout@v4

- name: Build Main Code
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: v5.2.2
esp_idf_version: release-v5.4
target: esp32s3
path: '.'
command: 'idf.py build'

- name: Upload Build Outputs
uses: actions/upload-artifact@v4
id: zip_step
with:
name: build-artifacts
path: |
build/*.bin
build/*.elf
build/bootloader/bootloader.bin
build/partition_table/partition-table.bin
build/*.bin
build/flasher_args.json
build/flash_args

- name: Attach files to release
Expand All @@ -42,7 +47,21 @@ jobs:
with:
files: |
build/*.bin
build/*.elf
build/bootloader/bootloader.bin
build/partition_table/partition-table.bin
build/flasher_args.json
build/flash_args

package:
name: Package the binaries into an executables for Windows, MacOS, and Linux (Ubuntu)
needs: build
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: esp-cpp/[email protected]
with:
zipfile-id: ${{ needs.build.outputs.zipfile-id }}
programmer-name: 'wireless-debug-display_programmer'
6 changes: 2 additions & 4 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Run static analysis
uses: esp-cpp/StaticAnalysis@master
Expand All @@ -19,7 +17,7 @@ jobs:
use_cmake: false

# Use the 5.2 release version since it's what we build with
esp_idf_version: release/v5.2
esp_idf_version: release/v5.4

# (Optional) cppcheck args
cppcheck_args: -i$GITHUB_WORKSPACE/components/espp -i$GITHUB_WORKSPACE/components/esp-protocols --force --enable=all --inline-suppr --inconclusive --platform=mips32 --std=c++17 --suppressions-list=$GITHUB_WORKSPACE/suppressions.txt
cppcheck_args: --check-level=exhaustive --force --enable=all --inline-suppr --inconclusive --platform=mips32 --std=c++17 --suppressions-list=$GITHUB_WORKSPACE/suppressions.txt
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@
build/
sdkconfig
sdkconfig.old
managed_components/
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
[submodule "components/espp"]
path = components/espp
url = [email protected]:esp-cpp/espp
[submodule "components/esp-protocols"]
path = components/esp-protocols
url = [email protected]:espressif/esp-protocols
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# The following lines of boilerplate have to be in your project's CMakeLists
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.20)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)

# add the component directories that we want to use
set(EXTRA_COMPONENT_DIRS
"components/"
"components/espp/components/"
"components/esp-protocols/components"
)

# set the hal component to use based on the target
Expand Down
16 changes: 0 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,6 @@ All other text is treated as a log and written out to the log
window. Note, we do not wrap lines, so any text that would go off the
edge of the screen is simply not rendered.

## Cloning

Since this repo contains a submodule, you need to make sure you clone it
recursively, e.g. with:

``` sh
git clone --recurse-submodules <your repo name>
```

Alternatively, you can always ensure the submodules are up to date after cloning
(or if you forgot to clone recursively) by running:

``` sh
git submodule update --init --recursive
```

## Build and Flash

Build the project and flash it to the board, then run monitor tool to view serial output:
Expand Down
1 change: 0 additions & 1 deletion components/esp-protocols
Submodule esp-protocols deleted from 25d842
1 change: 0 additions & 1 deletion components/espp
Submodule espp deleted from a93e6a
18 changes: 18 additions & 0 deletions components/gui/idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## IDF Component Manager Manifest File
dependencies:
## Required IDF version
idf:
version: '>=4.1.0'
# # Put list of dependencies here
# # For components maintained by Espressif:
# component: "~1.0.0"
# # For 3rd party components:
# username/component: ">=1.0.0,<2.0.0"
# username2/component2:
# version: "~1.0.0"
# # For transient dependencies `public` flag can be set.
# # `public` flag doesn't have an effect dependencies of the `main` component.
# # All dependencies of `main` are public by default.
# public: true
espp/task: '>=1.0'
espp/display: '>=1.0'
4 changes: 3 additions & 1 deletion components/gui/include/graph_window.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class GraphWindow : public Window {

void init(lv_obj_t *parent, size_t width, size_t height) override;
void update() override;
void set_max_point_count(size_t max_point_count);

void clear_plots(void);
void add_data(const std::string &plot_name, int new_data);
Expand All @@ -24,8 +25,9 @@ class GraphWindow : public Window {
void update_ticks(void);

private:
lv_obj_t *wrapper_{nullptr};
lv_obj_t *y_scale_{nullptr};
lv_obj_t *chart_{nullptr};
lv_obj_t *legend_{nullptr};
std::string y_ticks_{""};
std::unordered_map<std::string, lv_chart_series_t *> plot_map_{};
};
20 changes: 14 additions & 6 deletions components/gui/include/gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,32 @@

class Gui {
public:
using Pixel = lv_color16_t;
using Display = espp::Display<Pixel>;

const std::string delimeter_data = "::"; ///< Delimeter indicating this contains plottable data
const std::string delimeter_command = "+++"; ///< Delimeter indicating this contains a command
const std::string command_remove_plot = "RP:"; ///< Command: remove plot
const std::string command_clear_plots = "CP"; ///< Command: clear plots
const std::string command_clear_logs = "CL"; ///< Command: clear logs

struct Config {
std::shared_ptr<espp::Display> display;
espp::Logger::Verbosity log_level{espp::Logger::Verbosity::WARN};
std::shared_ptr<Display> display; ///< Display to use
size_t max_chart_point_count{30}; ///< Max number of points to show on the chart
espp::Logger::Verbosity log_level{espp::Logger::Verbosity::WARN}; ///< Log level
};

explicit Gui(const Config &config)
: display_(config.display)
, logger_({.tag = "Gui", .level = config.log_level}) {
init_ui();
plot_window_.set_max_point_count(config.max_chart_point_count);
plot_window_.clear_plots();
// now start the gui updater task
using namespace std::placeholders;
task_ = espp::Task::make_unique({.name = "Gui Task",
.callback = std::bind(&Gui::update, this, _1, _2),
.stack_size_bytes = 6 * 1024});
task_ = espp::Task::make_unique(
espp::Task::Config{.callback = [this](auto &m, auto &cv) -> bool { return update(m, cv); },
.task_config = {.name = "Gui Task", .stack_size_bytes = 6 * 1024}});
task_->start();
}

Expand All @@ -54,6 +60,8 @@ class Gui {

bool handle_data();

void set_chart_max_point_count(size_t count) { plot_window_.set_max_point_count(count); }

protected:
void init_ui();
void deinit_ui();
Expand Down Expand Up @@ -107,7 +115,7 @@ class Gui {
std::mutex data_queue_mutex_;
std::queue<std::string> data_queue_;

std::shared_ptr<espp::Display> display_;
std::shared_ptr<Display> display_;
std::unique_ptr<espp::Task> task_;

espp::Logger logger_;
Expand Down
2 changes: 1 addition & 1 deletion components/gui/include/window.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "lvgl.h"
#include <lvgl.h>

class Window {
public:
Expand Down
4 changes: 2 additions & 2 deletions components/gui/src/converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Converter::Status Converter::str2int(int &i, char const *s, int base) {
long l;
errno = 0;
l = strtol(s, &end, base);
if ((errno == ERANGE && l == LONG_MAX) || l > INT_MAX) {
if (errno == ERANGE && l == LONG_MAX) {
return Status::Overflow;
}
if ((errno == ERANGE && l == LONG_MIN) || l < INT_MIN) {
if (errno == ERANGE && l == LONG_MIN) {
return Status::Underflow;
}
if (*s == '\0' || *end != '\0') {
Expand Down
Loading