diff --git a/.github/workflows/sanity-build.yml b/.github/workflows/sanity-build.yml new file mode 100644 index 0000000..3f5fb75 --- /dev/null +++ b/.github/workflows/sanity-build.yml @@ -0,0 +1,42 @@ +name: Sanity Build (Debian Bookworm x64) + +on: + push: + branches: [main] + pull_request: + +jobs: + sanity-build: + name: Sanity Build + runs-on: ubuntu-latest + permissions: + contents: read + container: + image: debian:bookworm + + steps: + - name: Install dependencies + run: | + apt-get update -qq + apt-get install -y -qq --no-install-recommends \ + build-essential cmake git pkg-config ca-certificates \ + libserial-dev libgpiod-dev libzmq3-dev \ + libpistache-dev rapidjson-dev nlohmann-json3-dev libzmq3-dev cppzmq-dev libtime-dev \ + libcamera-dev libopencv-dev + update-ca-certificates + + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Build - mandeye-standard-rpi5.h + run: | + cmake -B build -DCMAKE_BUILD_TYPE=Release \ + -DMANDEYE_HARDWARE_HEADER=mandeye-standard-rpi5.h + cmake --build build -j$(nproc) + + - name: Build - mandeye-direct-cm5.h + run: | + cmake -B build -DCMAKE_BUILD_TYPE=Release \ + -DMANDEYE_HARDWARE_HEADER=mandeye-direct-cm5.h + cmake --build build -j$(nproc) diff --git a/code/fake_pps.cpp b/code/fake_pps.cpp index a5089c4..1700db2 100644 --- a/code/fake_pps.cpp +++ b/code/fake_pps.cpp @@ -87,7 +87,7 @@ void oneSecondThread() serialPorts.emplace_back(std::move(serialPort)); } const auto ouputs = hardware::GetLidarSyncGPIO(); - const auto& chipPath = mandeye::GetGPIOChip(); + const auto& chipPath = hardware::GetGPIOChip(); std::cout << "Opening GPIO chip " << chipPath << std::endl; gpiod_chip* chip = gpiod_chip_open(chipPath); @@ -115,7 +115,7 @@ void oneSecondThread() } syncOutsLines.emplace_back(line); } - assert(serialPorts.size() == syncOuts.size()); + assert(serialPorts.size() == syncOutsLines.size()); //setup pps gpio constexpr uint64_t Rate = 1000; diff --git a/code/gpios.cpp b/code/gpios.cpp index 1486a88..af2a1e7 100644 --- a/code/gpios.cpp +++ b/code/gpios.cpp @@ -47,7 +47,7 @@ GpioClient::GpioClient(bool sim) if(!sim) { - const auto& chipPath = mandeye::GetGPIOChip(); + const auto& chipPath = hardware::GetGPIOChip(); std::cout << "Opening GPIO chip " << chipPath << std::endl; m_chip = gpiod_chip_open(chipPath); diff --git a/code/hardware_config/hardware_common.h b/code/hardware_config/hardware_common.h index 68e8a2c..8d0d68d 100644 --- a/code/hardware_config/hardware_common.h +++ b/code/hardware_config/hardware_common.h @@ -1,5 +1,4 @@ #pragma once -#include "gpios.h" #include "state.h" #include @@ -11,6 +10,8 @@ enum class LED LED_GPIO_COPY_DATA, LED_GPIO_CONTINOUS_SCANNING, BUZZER, + LIDAR_SYNC_1, + LIDAR_SYNC_2, }; enum class BUTTON @@ -29,3 +30,5 @@ enum class GPIO_PULL OFF }; }; + +#include "gpios.h" diff --git a/code/state.h b/code/state.h index ff6d3c9..5a55990 100644 --- a/code/state.h +++ b/code/state.h @@ -1,5 +1,6 @@ #pragma once #include +#include namespace mandeye { enum class States diff --git a/extras/FakePPS/main.cpp b/extras/FakePPS/main.cpp index 80476cb..01a09ea 100644 --- a/extras/FakePPS/main.cpp +++ b/extras/FakePPS/main.cpp @@ -88,7 +88,7 @@ void oneSecondThread() serialPorts.emplace_back(std::move(serialPort)); } const auto ouputs = hardware::GetLidarSyncGPIO(); - const auto& chipPath = mandeye::GetGPIOChip(); + const auto& chipPath = hardware::GetGPIOChip(); std::cout << "Opening GPIO chip " << chipPath << std::endl; gpiod_chip* chip = gpiod_chip_open(chipPath);