Skip to content

Commit e6474d4

Browse files
Attempted to fixup CI build for Windows and Linux
1 parent e3206c1 commit e6474d4

File tree

6 files changed

+28
-17
lines changed

6 files changed

+28
-17
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
5050
cmakeListsTxtPath: ${{ github.workspace }}/Firmware/CMakeLists.txt
5151
cmakeBuildType: Debug
52-
cmakeAppendedArgs: '-DPACKAGE_TESTS=ON -DTARGET_PLATFORM:STRING="FIRMWARE_SIMULATOR"'
52+
cmakeAppendedArgs: '-DPACKAGE_TESTS=ON -DTARGET_PLATFORM:STRING="FIRMWARE_SIMULATOR" -DCMAKE_BUILD_TYPE:STRING=Release'
5353
buildDirectory: '${{ runner.workspace }}/build/vsfirmwarebuild'
5454
buildWithCMake: true
5555
- name : Run firmware testing

Firmware/drivers/gpio/gpio_pin.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,6 @@ template <std::uint8_t GpioPinNumber, Direction pinDirection>
5252
GpioPin<GpioPinNumber, pinDirection>::~GpioPin() = default;
5353

5454
template class GpioPin<Gpio::Pins::Display_DataCommand, Direction::Output>;
55+
template class GpioPin<Gpio::Pins::Display_Reset, Direction::Output>;
56+
template class GpioPin<Gpio::Pins::LedPin, Direction::Output>;
5557
}; // namespace Gpio

Firmware/drivers/gpio/inc/gpio/gpio_pin.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ inline constexpr std::uint8_t Display_DataCommand = DISP_DC_PIN;
1313
inline constexpr std::uint8_t Display_Reset = DISP_RST;
1414
inline constexpr std::uint8_t LedPin = 13;
1515
#else
16-
inline constexpr std::uint8_t Display_DataCommand = 0;
17-
inline constexpr std::uint8_t Display_Reset = 0;
18-
inline constexpr std::uint8_t LedPin = 0;
16+
inline constexpr std::uint8_t Display_DataCommand = 26;
17+
inline constexpr std::uint8_t Display_Reset = 31;
18+
inline constexpr std::uint8_t LedPin = 13;
1919
#endif
2020

2121
} // namespace Gpio::Pins

Firmware/graphics/platform/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ elseif( ${TARGET_PLATFORM} STREQUAL "FIRMWARE_SIMULATOR" )
3232
target_compile_definitions(
3333
graphics_backend
3434
PRIVATE
35-
USE_WINSDL_BACKEND
35+
USE_SDL_BACKEND
3636
)
3737
target_link_libraries(
3838
graphics_backend

Firmware/graphics/platform/gs_platform_layer.cpp

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void PlatformBackend::executeLvTaskHandler() noexcept
7777
} // namespace Graphics
7878
#endif
7979

80-
#if defined USE_WINSDL_BACKEND
80+
#if defined USE_SDL_BACKEND
8181

8282
#include <chrono>
8383
#include <thread>
@@ -92,7 +92,10 @@ void PlatformBackend::executeLvTaskHandler() noexcept
9292
namespace Graphics
9393
{
9494

95-
PlatformBackend::PlatformBackend() noexcept = default;
95+
PlatformBackend::PlatformBackend() noexcept
96+
{
97+
m_isTickThreadRunning.store(false);
98+
};
9699

97100
void PlatformBackend::platformDependentInit(lv_disp_drv_t* _displayDriver) noexcept
98101
{
@@ -102,14 +105,6 @@ void PlatformBackend::platformDependentInit(lv_disp_drv_t* _displayDriver) noexc
102105

103106
void PlatformBackend::initPlatformGfxTimer() noexcept
104107
{
105-
m_tickThread = std::thread([] {
106-
while (true)
107-
{
108-
lv_tick_inc(LvglNotificationTime);
109-
std::this_thread::sleep_for(std::chrono::milliseconds(LvglNotificationTime));
110-
}
111-
});
112-
m_tickThread.detach();
113108
indevPlatformInit();
114109
lv_indev_drv_init(&m_indevDriver);
115110
}
@@ -144,6 +139,18 @@ void PlatformBackend::memoryMonitor(lv_timer_t* _param) noexcept
144139

145140
void PlatformBackend::executeLvTaskHandler() noexcept
146141
{
142+
if(!m_isTickThreadRunning)
143+
{
144+
m_isTickThreadRunning = true;
145+
m_tickThread = std::thread([this] {
146+
while (m_isTickThreadRunning)
147+
{
148+
lv_tick_inc(LvglNotificationTime);
149+
std::this_thread::sleep_for(std::chrono::milliseconds(LvglNotificationTime));
150+
}
151+
});
152+
m_tickThread.detach();
153+
}
147154
lv_task_handler();
148155
std::this_thread::sleep_for(std::chrono::milliseconds(LvglNotificationTime));
149156
}

Firmware/graphics/platform/gs_platform_layer.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
#include <lvgl.h>
66

7-
#ifdef USE_WINSDL_BACKEND
7+
#ifdef USE_SDL_BACKEND
88
#include <chrono>
99
#include <thread>
10+
#include <atomic>
1011
#endif // USE_WINSDL_BACKEND
1112

1213
namespace DisplayDriver
@@ -52,8 +53,9 @@ class PlatformBackend
5253
std::unique_ptr<TDisplayDriver> m_hardwareDisplayDriver;
5354
#endif
5455

55-
#if defined USE_WINSDL_BACKEND
56+
#if defined USE_SDL_BACKEND
5657
std::thread m_tickThread;
58+
std::atomic_bool m_isTickThreadRunning;
5759
lv_indev_drv_t m_indevDriver;
5860
#endif
5961
};

0 commit comments

Comments
 (0)