-
-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #435 from lovyan03/develop
Develop
- Loading branch information
Showing
61 changed files
with
1,490 additions
and
847 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,27 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"name": "x64-Debug", | ||
"generator": "Ninja", | ||
"configurationType": "Debug", | ||
"inheritEnvironments": [ "clang_cl_x64_x64" ], | ||
"buildRoot": "${projectDir}\\out\\build\\${name}", | ||
"installRoot": "${projectDir}\\out\\install\\${name}", | ||
"cmakeCommandArgs": "", | ||
"buildCommandArgs": "", | ||
"ctestCommandArgs": "" | ||
} | ||
] | ||
{ | ||
"configurations": [ | ||
{ | ||
"name": "x64-Debug", | ||
"generator": "Ninja", | ||
"configurationType": "Debug", | ||
"inheritEnvironments": [ "clang_cl_x64_x64" ], | ||
"buildRoot": "${projectDir}\\.out\\build\\${name}", | ||
"installRoot": "${projectDir}\\.out\\install\\${name}", | ||
"cmakeCommandArgs": "", | ||
"buildCommandArgs": "", | ||
"ctestCommandArgs": "" | ||
}, | ||
{ | ||
"name": "x64-Release", | ||
"generator": "Ninja", | ||
"configurationType": "Release", | ||
"buildRoot": "${projectDir}\\.out\\build\\${name}", | ||
"installRoot": "${projectDir}\\.out\\install\\${name}", | ||
"cmakeCommandArgs": "", | ||
"buildCommandArgs": "", | ||
"ctestCommandArgs": "", | ||
"inheritEnvironments": [ "clang_cl_x64_x64" ], | ||
"variables": [] | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <lgfx/v1/platforms/sdl/Panel_sdl.hpp> | ||
#if defined ( SDL_h_ ) | ||
|
||
void setup(void); | ||
void loop(void); | ||
|
||
__attribute__((weak)) | ||
int user_func(bool* running) | ||
{ | ||
setup(); | ||
do | ||
{ | ||
loop(); | ||
} while (*running); | ||
return 0; | ||
} | ||
|
||
int main(int, char**) | ||
{ | ||
return lgfx::Panel_sdl::main(user_func); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
|
||
## Visual Studio Code + PlatformIO + SDL2 環境で LovyanGFXを使用する手順 | ||
|
||
まず最初にVisual Studio Code をインストールし、PlatformIO を使用できる状態にする。 | ||
|
||
--- | ||
|
||
### PlatformIOにて、 `platform = native` のビルドができる状態にする。 | ||
|
||
手順は下記 URL から `Installation` の項目を読んで実施する。 | ||
https://docs.platformio.org/en/latest/platforms/native.html#installation | ||
|
||
#### Linuxの場合 | ||
|
||
`apt` で `build-essential` をインストールする。 | ||
``` | ||
sudo apt update | ||
sudo apt install build-essential | ||
``` | ||
|
||
#### macOSの場合 | ||
ターミナルから `xcode-select` をインストールする。 | ||
``` | ||
xcode-select --install | ||
``` | ||
|
||
#### Windowsの場合 | ||
`MSYS2` をここ https://www.msys2.org/ から入手してインストールする。 | ||
そのあと、Windowsの`システムのプロパティ`->`環境変数` を開き、 `PATH` に以下の3つのパスを追加する。 | ||
``` | ||
C:\msys64\mingw64\bin | ||
C:\msys64\ucrt64\bin | ||
C:\msys64\usr\bin | ||
``` | ||
|
||
|
||
--- | ||
|
||
### PlatformIOにて、 SDL2 が使用できる状態にする。 | ||
|
||
手順は下記 URL から `Install SDL2` の項目を読んで実施する。 | ||
https://docs.lvgl.io/latest/en/html/get-started/pc-simulator.html#install-sdl-2 | ||
|
||
|
||
#### Linuxの場合 | ||
|
||
apt-getでlibsdl2をインストールする。 | ||
|
||
``` | ||
sudo apt-get install libsdl2 libsdl2-dev | ||
``` | ||
|
||
#### MacOS OSXの場合 | ||
|
||
Homebrewを使ってsdl2をインストールする。 | ||
``` | ||
brew install sdl2 | ||
``` | ||
|
||
#### Windowsの場合 | ||
|
||
`platform = native` のビルドを可能にする手順において、 msys2をインストール済みのはずなので、 | ||
githubの SDLのリポジトリにアクセスし、SDL2-devel-x.xx.x-mingw のリリースパッケージを入手する。 | ||
https://github.com/libsdl-org/SDL/releases | ||
|
||
本記事作成時点のファイル名は `SDL2-devel-2.28.1-mingw.zip` | ||
これを解凍し、出てきたフォルダの中にある `x86_64-w64-mingw32` フォルダを開き、中に以下の 4つのフォルダがあることを確認。 | ||
- share | ||
- bin | ||
- include | ||
- lib | ||
|
||
C:\msys64\mingw64\ を開き、上記の4つのフォルダと同名のフォルダが存在することを確認したら、C:\msys64\mingw64\ 内に上記フォルダの内容を追加する。(上書きコピー) | ||
|
||
--- | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
; PlatformIO Project Configuration File | ||
; | ||
; Build options: build flags, source filter | ||
; Upload options: custom upload port, speed and extra flags | ||
; Library options: dependencies, extra library storages | ||
; Advanced options: extra scripting | ||
; | ||
; Please visit documentation for the other options and examples | ||
; https://docs.platformio.org/page/projectconf.html | ||
|
||
[env:native] | ||
platform = native | ||
build_type = debug | ||
build_flags = -O0 -xc++ -std=c++14 -lSDL2 | ||
-I"/usr/local/include/SDL2" ; for intel mac homebrew SDL2 | ||
-L"/usr/local/lib" ; for intel mac homebrew SDL2 | ||
-I"${sysenv.HOMEBREW_PREFIX}/include/SDL2" ; for arm mac homebrew SDL2 | ||
-L"${sysenv.HOMEBREW_PREFIX}/lib" ; for arm mac homebrew SDL2 | ||
|
||
[esp32_base] | ||
build_type = debug | ||
platform = espressif32 | ||
board = esp32dev | ||
upload_speed = 1500000 | ||
monitor_speed = 115200 | ||
monitor_filters = esp32_exception_decoder | ||
|
||
[env:esp32_arduino] | ||
extends = esp32_base | ||
framework = arduino | ||
|
||
[env:esp32_idf] | ||
extends = esp32_base | ||
framework = espidf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <lgfx/v1/platforms/sdl/Panel_sdl.hpp> | ||
#if defined ( SDL_h_ ) | ||
|
||
void setup(void); | ||
void loop(void); | ||
|
||
__attribute__((weak)) | ||
int user_func(bool* running) | ||
{ | ||
setup(); | ||
do | ||
{ | ||
loop(); | ||
} while (*running); | ||
return 0; | ||
} | ||
|
||
int main(int, char**) | ||
{ | ||
return lgfx::Panel_sdl::main(user_func); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#define LGFX_AUTODETECT | ||
#include <LovyanGFX.h> | ||
#include <LGFX_AUTODETECT.hpp> | ||
|
||
#if defined ( SDL_h_ ) | ||
static LGFX lcd ( 320, 240, 2 ); | ||
#else | ||
static LGFX lcd; | ||
#endif | ||
|
||
void setup(void) | ||
{ | ||
lcd.init(); | ||
} | ||
|
||
void loop(void) | ||
{ | ||
lcd.fillCircle(rand()%lcd.width(), rand()%lcd.height(), 16, rand()); | ||
} | ||
|
||
|
||
|
||
#if defined ( ESP_PLATFORM ) && !defined ( ARDUINO ) | ||
extern "C" { | ||
int app_main(int, char**) | ||
{ | ||
setup(); | ||
for (;;) { | ||
loop(); | ||
} | ||
return 0; | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.