Skip to content

Commit

Permalink
Use version 2.x.x of uuid-console
Browse files Browse the repository at this point in the history
  • Loading branch information
nomis committed Nov 26, 2022
1 parent 77281e2 commit fc6c19e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
1 change: 1 addition & 0 deletions docs/changelog.rst
Expand Up @@ -8,6 +8,7 @@ Changed
~~~~~~~

* Use ``PSTR_ALIGN`` for flash strings.
* Use version 2.x.x of ``uuid-console``.

0.1.4_ |--| 2022-10-29
----------------------
Expand Down
26 changes: 12 additions & 14 deletions examples/DigitalIO.cpp
Expand Up @@ -45,20 +45,20 @@ void setup() {
pin, arguments[1].c_str());
},

[] (Shell &shell __attribute__((unused)),
const std::vector<std::string> &arguments)
[] (Shell &shell, const std::vector<std::string> &current_arguments,
const std::string &next_argument)
-> const std::vector<std::string> {
if (arguments.size() == 1) {
if (current_arguments.size() == 1) {
/* The first argument has been provided, so return
* completion values for the second argument.
*/
return std::vector<std::string>{
return {
read_flash_string(F("INPUT")),
read_flash_string(F("OUTPUT")),
read_flash_string(F("INPUT_PULLUP"))
};
} else {
return std::vector<std::string>{};
return {};
}
}
);
Expand Down Expand Up @@ -96,33 +96,31 @@ void setup() {
arguments[1].c_str(), pin);
},

[] (Shell &shell __attribute__((unused)),
const std::vector<std::string> &arguments)
[] (Shell &shell, const std::vector<std::string> &current_arguments,
const std::string &next_argument)
-> const std::vector<std::string> {
if (arguments.size() == 1) {
if (current_arguments.size() == 1) {
/* The first argument has been provided, so return
* completion values for the second argument.
*/
return std::vector<std::string>{
return {
read_flash_string(F("HIGH")),
read_flash_string(F("LOW"))
};
} else {
return std::vector<std::string>{};
return {};
}
}
);

commands->add_command(flash_string_vector{F("help")},
[] (Shell &shell, const std::vector<std::string> &arguments
__attribute__((unused))) {
[] (Shell &shell, const std::vector<std::string> &arguments) {
shell.print_all_available_commands();
}
);

commands->add_command(flash_string_vector{F("exit")},
[] (Shell &shell, const std::vector<std::string> &arguments
__attribute__((unused))) {
[] (Shell &shell, const std::vector<std::string> &arguments) {
shell.stop();
}
);
Expand Down
5 changes: 3 additions & 2 deletions library.json
Expand Up @@ -28,14 +28,15 @@
],
"dependencies": {
"nomis/uuid-common": "^1.2.0",
"nomis/uuid-log": "^2.3.0",
"nomis/uuid-console": "^1.0.0"
"nomis/uuid-log": ">=2.3.0,<4",
"nomis/uuid-console": ">=1.0.1,<3"
},
"build": {
"flags": "-Wall -Wextra",
"libLDFMode": "chain+"
},
"headers": [
"uuid/console.h",
"uuid/telnet.h"
]
}
2 changes: 1 addition & 1 deletion test/build/pio_build.ini
Expand Up @@ -4,7 +4,7 @@ extra_configs = pio_local.ini
[common]
framework = arduino
build_flags = -std=c++11 -Os -Wall -Wextra
src_build_flags = -Werror -Wno-format
src_build_flags = -Werror -Wno-format -Wno-unused-parameter
lib_ldf_mode = chain+
lib_deps = uuid-console

Expand Down

0 comments on commit fc6c19e

Please sign in to comment.