Skip to content

Commit

Permalink
fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
lovyan03 committed Jul 9, 2023
1 parent 9001e6f commit 62f4b61
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 30 deletions.
52 changes: 23 additions & 29 deletions examples_for_PC/CMake_SDL/LGFX_SDL.cpp
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
#include <thread>

#define LGFX_USE_V1
#include <LovyanGFX.hpp>
#include <LGFX_AUTODETECT.hpp>

void setup(void);
void loop(void);

static void loopThread(void)
{
setup();
for (;;)
{
std::this_thread::yield();
loop();
}
}

int main(int, char**)
{
std::thread sub_thread(loopThread);
for (;;)
{
std::this_thread::yield();
lgfx::Panel_sdl::sdl_event_handler();
SDL_Delay(5);
}
}
#include <lgfx/v1/platforms/sdl/Panel_sdl.hpp>
#if defined ( SDL_h_ )

void setup(void);
void loop(void);

#if __has_include(<windows.h>)
#include <windows.h>
#include <tchar.h>
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
#else
int main(int, char**)
#endif
{
setup();
for (;;)
{
lgfx::Panel_sdl::sdl_event_handler();
loop();
}
return 1;
}
#endif
5 changes: 4 additions & 1 deletion src/lgfx/v1/platforms/esp32/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,17 @@ Original Source:
#include <soc/i2c_struct.h>
#include <soc/apb_ctrl_reg.h>
#include <soc/efuse_reg.h>
#include <hal/gpio_hal.h>

#include <esp_log.h>

#if __has_include (<soc/soc_caps.h>)
#include <soc/soc_caps.h>
#endif

#if __has_include (<hal/gpio_hal.h>)
#include <hal/gpio_hal.h>
#endif

#if __has_include (<esp_private/periph_ctrl.h>)
#include <esp_private/periph_ctrl.h>
#else
Expand Down

0 comments on commit 62f4b61

Please sign in to comment.