diff --git a/CMakeLists.txt b/CMakeLists.txt index d530c0c..05b5623 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,7 @@ file(GLOB_RECURSE VAR_APP_SOURCE # message("VAR_APP_SOURCE: ${VAR_APP_SOURCE}") zadd_executable( TARGET - app.out # + a8000_linux_hardware_service # INSTALL ./app/ # diff --git a/README.md b/README.md index 2c35890..3e08059 100644 --- a/README.md +++ b/README.md @@ -21,4 +21,7 @@ ``` 第三方库说明: https://iflytop1.feishu.cn/wiki/wikcnDuCFRGDunHGzns8gRV4Ahh + + +sudo apt install clang llvm gcc-aarch64-linux-gnu g++-aarch64-linux-gnu ``` \ No newline at end of file diff --git a/resource/config.ini b/resource/config.ini new file mode 100644 index 0000000..afafdf7 --- /dev/null +++ b/resource/config.ini @@ -0,0 +1,22 @@ +[can] +type=zexcan +ifname=can0 +baudrate=500000 +enable=true + +[printer] +type=uart +ifname=/dev/ttyS1 +baudrate=115200 +enable=true + +[emergency-key] +type=input-key +pinnum=GPIO2-A3 +enable=true + +[lis] +type=uart +ifname=/dev/ttyS2 +baudrate=115200 +enable=true \ No newline at end of file diff --git a/test/config.ini b/test/config.ini new file mode 100644 index 0000000..afafdf7 --- /dev/null +++ b/test/config.ini @@ -0,0 +1,22 @@ +[can] +type=zexcan +ifname=can0 +baudrate=500000 +enable=true + +[printer] +type=uart +ifname=/dev/ttyS1 +baudrate=115200 +enable=true + +[emergency-key] +type=input-key +pinnum=GPIO2-A3 +enable=true + +[lis] +type=uart +ifname=/dev/ttyS2 +baudrate=115200 +enable=true \ No newline at end of file diff --git a/test/tomldemo.cpp b/test/tomldemo.cpp index 834887f..8806edb 100644 --- a/test/tomldemo.cpp +++ b/test/tomldemo.cpp @@ -1,42 +1,20 @@ -#include -#include #include +#include #include +#include -//g++ tomldemo.cpp -I ../libs/tomlplusplus -std=c++17 +// g++ tomldemo.cpp -I ../libs/tomlplusplus -std=c++17 using namespace std::literals; - -int main(int argc, char const* argv[]) { - auto config = toml::parse_file("configuration.toml"); - - // get key-value pairs - std::string_view library_name = config["library"]["name"].value_or(""sv); - std::string_view library_author = config["library"]["authors"][0].value_or(""sv); - int64_t depends_on_cpp_version = config["dependencies"]["cpp"].value_or(0); - - // modify the data - config.insert_or_assign("alternatives", toml::array{"cpptoml", "toml11", "Boost.TOML"}); - - // use a visitor to iterate over heterogenous data - config.for_each([](auto& key, auto& value) { - std::cout << value << "\n"; - // if constexpr (toml::is_string) do_something_with_string_values(value); - }); - - // you can also iterate more 'traditionally' using a ranged-for - for (auto&& [k, v] : config) { - // ... +int main(int argc, char** argv) { + toml::table tbl; + try { + tbl = toml::parse_file("config.ini"); + std::cout << tbl << "\n"; + } catch (const toml::parse_error& err) { + std::cerr << "Parsing failed:\n" << err << "\n"; + return 1; } - // re-serialize as TOML - std::cout << config << "\n"; - - // re-serialize as JSON - std::cout << toml::json_formatter{config} << "\n"; - - // re-serialize as YAML - std::cout << toml::yaml_formatter{config} << "\n"; return 0; } - diff --git a/build.sh b/tools/build.sh similarity index 100% rename from build.sh rename to tools/build.sh diff --git a/toolchain/.mark b/tools/deply.sh similarity index 100% rename from toolchain/.mark rename to tools/deply.sh diff --git a/packet.sh b/tools/packet.sh similarity index 100% rename from packet.sh rename to tools/packet.sh