Initial commit
This commit is contained in:
commit
64a227437d
1920 files changed
+3428556
No files matched your search
@@ -0,0 +1 @@
|
||||
github: lovyan03
|
||||
@@ -0,0 +1,52 @@
|
||||
---
|
||||
name: Bug report (不具合報告)
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Carefully written Issues are more likely to be given priority.**
|
||||
**丁寧に記述された報告は優先して対応される可能性が高くなります。**
|
||||
|
||||
## Environment ( 実行環境 )
|
||||
|
||||
- MCU or Board name: [ESP-WROOM-32|ESP32-S3-BOX|M5Stack|WioTerminal|RPi2040|other]
|
||||
- Panel Driver IC: [ILI9341|SSD1963|ST7796|other]
|
||||
- Bus type: [SPI|I2C|Parallel8|Parallel16|other]
|
||||
- LovyanGFX version: [v0.4.17|latest develop|other]
|
||||
- FrameWork version: [ArduinoESP32 v2.0.3|ESP-IDF v4.4|other]
|
||||
- Build Environment: [ArduinoIDE|PlatformIO|Eclipse|other]
|
||||
- Operating System: [Windows|Linux|macOS]
|
||||
|
||||
## Problem Description ( 問題の内容 )
|
||||
|
||||
### Expected Behavior ( 期待される動作 )
|
||||
|
||||
### Actual Behavior ( 実際の動作 )
|
||||
|
||||
### Steps to reproduce ( 再現のための前提条件 )
|
||||
|
||||
1. step1
|
||||
2. ...
|
||||
|
||||
// If possible, attach a picture of your setup/wiring here.
|
||||
|
||||
|
||||
### Code to reproduce this issue ( 再現させるためのコード )
|
||||
|
||||
**Please submit complete source code that can reproduce your problem.**
|
||||
**あなたの問題を再現できる完全なソースコードを提示してください。**
|
||||
|
||||
```cpp
|
||||
// the code should be wrapped in the ```cpp tag so that it will be displayed better.
|
||||
#include "esp_log.h"
|
||||
|
||||
void app_main()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
```
|
||||
// If your code is longer than 30 lines, [GIST](https://gist.github.com) is preferred.
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
---
|
||||
name: Device support request (デバイスサポート要望)
|
||||
about: MCU / LCD / OLED / EPD / etc... device support request
|
||||
title: ''
|
||||
labels: device support request
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Carefully written requests are more likely to be given priority.**
|
||||
**丁寧に記述された要望は優先して対応される可能性が高くなります。**
|
||||
|
||||
### Device Name (デバイスの名称・型番等)
|
||||
|
||||
### URL of Device Specifications document (仕様書等のURL)
|
||||
|
||||
### URL of the store where we can purchase (商品を購入できるURL)
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
---
|
||||
name: Feature request (機能要望)
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Carefully written requests are more likely to be given priority.**
|
||||
**丁寧に記述された要望は優先して対応される可能性が高くなります。**
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
@@ -0,0 +1,40 @@
|
||||
cmake_minimum_required (VERSION 3.8)
|
||||
project(LGFXOpenCV)
|
||||
|
||||
# Use this if OpenCV_DIR was not added to the PATH
|
||||
# set( OpenCV_DIR "C:/path/to/opencv/build" )
|
||||
|
||||
find_package(OpenCV REQUIRED )
|
||||
|
||||
# Uncomment this if LovyanGFX_DIR was not added to the PATH
|
||||
set( LovyanGFX_DIR "../../../LovyanGFX/src" )
|
||||
|
||||
message(STATUS "LGFXOpenCV status:")
|
||||
message(STATUS " LovyanGFX dir = ${LovyanGFX_DIR}")
|
||||
message(STATUS " OpenCV config = ${OpenCV_DIR}")
|
||||
message(STATUS " OpenCV version = ${OpenCV_VERSION}")
|
||||
message(STATUS " OpenCV libraries = ${OpenCV_LIBS}")
|
||||
message(STATUS " OpenCV include path = ${OpenCV_INCLUDE_DIRS}")
|
||||
|
||||
add_definitions(-DLGFX_OPENCV)
|
||||
|
||||
file(GLOB Target_Files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} CONFIGURE_DEPENDS
|
||||
*.cpp
|
||||
${LovyanGFX_DIR}/lgfx/Fonts/efont/*.c
|
||||
${LovyanGFX_DIR}/lgfx/Fonts/IPA/*.c
|
||||
${LovyanGFX_DIR}/lgfx/utility/*.c
|
||||
${LovyanGFX_DIR}/lgfx/v1/*.cpp
|
||||
${LovyanGFX_DIR}/lgfx/v1/misc/*.cpp
|
||||
${LovyanGFX_DIR}/lgfx/v1/panel/Panel_Device.cpp
|
||||
${LovyanGFX_DIR}/lgfx/v1/platforms/opencv/*.cpp
|
||||
)
|
||||
add_executable (LGFXOpenCV ${Target_Files})
|
||||
|
||||
if(UNIX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread")
|
||||
endif()
|
||||
|
||||
target_include_directories(LGFXOpenCV PUBLIC ${LovyanGFX_DIR} ${OpenCV_INCLUDE_DIRS})
|
||||
target_link_libraries(LGFXOpenCV PUBLIC ${OpenCV_LIBS})
|
||||
target_compile_features(LGFXOpenCV PRIVATE cxx_std_17)
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
cmake_minimum_required (VERSION 3.8)
|
||||
project(LGFX_SDL)
|
||||
|
||||
set( LovyanGFX_DIR "../../../LovyanGFX/src" )
|
||||
# set( SDL2_DIR "C:/path/to/SDL2" )
|
||||
|
||||
add_definitions(-DLGFX_SDL)
|
||||
|
||||
file(GLOB Target_Files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} CONFIGURE_DEPENDS
|
||||
*.cpp
|
||||
${LovyanGFX_DIR}/lgfx/Fonts/efont/*.c
|
||||
${LovyanGFX_DIR}/lgfx/Fonts/IPA/*.c
|
||||
${LovyanGFX_DIR}/lgfx/utility/*.c
|
||||
${LovyanGFX_DIR}/lgfx/v1/*.cpp
|
||||
${LovyanGFX_DIR}/lgfx/v1/misc/*.cpp
|
||||
${LovyanGFX_DIR}/lgfx/v1/panel/Panel_Device.cpp
|
||||
${LovyanGFX_DIR}/lgfx/v1/panel/Panel_FrameBufferBase.cpp
|
||||
${LovyanGFX_DIR}/lgfx/v1/platforms/sdl/*.cpp
|
||||
)
|
||||
add_executable (${PROJECT_NAME} ${Target_Files})
|
||||
|
||||
find_package(SDL2 REQUIRED)
|
||||
|
||||
message(STATUS "LGFX_SDL status:")
|
||||
message(STATUS " LovyanGFX dir = ${LovyanGFX_DIR}")
|
||||
message(STATUS " SDL2 include path = ${SDL2_INCLUDE_DIRS}")
|
||||
message(STATUS " SDL2 libraries = ${SDL2_LIBRARIES}")
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${LovyanGFX_DIR} ${SDL2_INCLUDE_DIRS})
|
||||
|
||||
if(UNIX)
|
||||
target_link_libraries(${PROJECT_NAME} -lpthread ${SDL2_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(CMAKE_CXX_COMPILER "clang++")
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC ${SDL2_LIBRARIES})
|
||||
# Copy the SDL .dll file into the application binary directory
|
||||
add_custom_command(
|
||||
TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
$<TARGET_FILE:SDL2::SDL2>
|
||||
$<TARGET_FILE_DIR:${PROJECT_NAME}>
|
||||
VERBATIM
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
set -eou pipefail
|
||||
|
||||
# List of examples that will be compiled by default
|
||||
EXAMPLES=${EXAMPLES:-"HowToUse/1_simple_use"}
|
||||
|
||||
# list of boards to compile for by default
|
||||
BOARDS=${BOARDS:-"m5stick-c seeed_wio_terminal adafruit_pybadge_m4 d1_mini"}
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
BOARD_OPTS=$(for b in $BOARDS; do echo -n "--board $b "; done)
|
||||
|
||||
cd "$DIR/../.."
|
||||
|
||||
for d in $EXAMPLES ; do
|
||||
echo "*** building example $d for $BOARDS ***"
|
||||
pio ci $BOARD_OPTS --lib=src "examples/$d/"*ino
|
||||
done
|
||||
@@ -0,0 +1,436 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* esp-idf-versions.php
|
||||
*
|
||||
* copyleft (c+) tobozo 2024
|
||||
*
|
||||
* builds an array of esp-idf-fqbn for a 2D workflow matrix [idf version ^ esp32 chip]
|
||||
* from dl.espressif.com/dl/esp-idf/idf_versions.js javascript object
|
||||
*
|
||||
* {
|
||||
* "esp-idf-fqbn": [
|
||||
* "esp32@5.2.1",
|
||||
* "esp32s2@5.2.1",
|
||||
* "esp32s3@5.2.1",
|
||||
* "esp32c6@5.2.1",
|
||||
* "esp32@5.1.4",
|
||||
* "esp32s2@5.1.4",
|
||||
* "esp32s3@5.1.4",
|
||||
* "esp32c6@5.1.4",
|
||||
* "esp32@5.0.6",
|
||||
* "esp32s2@5.0.6",
|
||||
* "esp32s3@5.0.6",
|
||||
* "esp32@4.4.7",
|
||||
* "esp32s2@4.4.7",
|
||||
* "esp32s3@4.4.7",
|
||||
* "esp32@4.4.6",
|
||||
* "esp32@4.3.6",
|
||||
* "esp32@4.1.4"
|
||||
* ]
|
||||
* }
|
||||
*
|
||||
*/
|
||||
|
||||
// hardcoded EOL versions, official versions will be added by the script
|
||||
$hardcoded_fqbns = ['esp32@4.3.6', 'esp32@4.1.4'];
|
||||
|
||||
// restrict output to these idf targets, other targets will be ignored
|
||||
$idf_boards = ['esp32', 'esp32s2', 'esp32s3', 'esp32c6'/*, 'esp32h2', 'esp32p4', 'esp32c5'*/];
|
||||
|
||||
// get the official support matrix from the espressif website
|
||||
// it contains a JavaScript object declaration with all necessary chip/version informations
|
||||
// this allows associating each version with a set of supported chips in the CI matrix
|
||||
$idf_versions_js_url = "https://dl.espressif.com/dl/esp-idf/idf_versions.js";
|
||||
$js = file_get_contents($idf_versions_js_url) or php_die("Unable to fetch ".$idf_versions_js_url);
|
||||
// convert the Javascript object to a PHP associative array
|
||||
$idf_versions_json = JsConverter::convertToArray( $js );
|
||||
// do some basic health checks
|
||||
!empty($idf_versions_json) or php_die("unable to parse idf_versions.js at ".$idf_versions_js_url);
|
||||
isset($idf_versions_json['VERSIONS']) or php_die("invalid JSON in ".$idf_versions_js_url);
|
||||
!empty($idf_versions_json['VERSIONS']) or php_die("no VERSIONS found in ".$idf_versions_js_url);
|
||||
|
||||
$fqbns = [];
|
||||
|
||||
foreach($idf_versions_json['VERSIONS'] as $version)
|
||||
{
|
||||
if(!isset($version['name']) || !isset($version['old']) || !isset($version['supported_targets']) )
|
||||
continue; // skip first entry, EOL, unsupported and preview versions
|
||||
if($version['old']!=='false')
|
||||
continue; // only keep current versions
|
||||
|
||||
foreach($version['supported_targets'] as $board)
|
||||
{
|
||||
if(in_array($board, $idf_boards)) // only keep supported targets
|
||||
{
|
||||
// e.g. esp32@5.2.1
|
||||
$fqbns[] = $board.'@'.str_replace(["v","V"], "", $version['name']);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// merge collected fqbns with hardcoded fqbns
|
||||
array_push($fqbns, ...$hardcoded_fqbns);
|
||||
|
||||
// print the json and exit
|
||||
php_die( json_encode( [ "esp-idf-fqbn" => $fqbns ], JSON_PRETTY_PRINT ), 0 );
|
||||
|
||||
// same as die() with with end of line
|
||||
function php_die($msg, $errcode=1)
|
||||
{
|
||||
echo $msg.PHP_EOL;
|
||||
exit($errcode);
|
||||
}
|
||||
|
||||
|
||||
// grabbed from https://github.com/ovidigital/js-object-to-json/blob/master/src/JsConverter.php
|
||||
// changes by tobozo:
|
||||
// - added ::trimToBrackets(string $input):string
|
||||
// - disabled the unquoting of booleans in ::convertToJson()
|
||||
class JsConverter
|
||||
{
|
||||
/**
|
||||
* Converts a JavaScript object string to a JSON formatted string.
|
||||
*
|
||||
* @param string $jsObjectString The JavaScript object
|
||||
* @return string
|
||||
*/
|
||||
public static function convertToJson(string $jsObjectString): string
|
||||
{
|
||||
$replacedStringsList = [];
|
||||
// Remove single line comments
|
||||
$convertedString = self::removeSingleLineComments($jsObjectString);
|
||||
// Remove functions from objects
|
||||
$convertedString = self::removeFunctions($convertedString);
|
||||
// Replace all delimited string literals with placeholders
|
||||
$convertedString = self::escapeSingleQuoteBetweenDoubleQuotes($convertedString);
|
||||
$convertedString = self::replaceSectionsWithPlaceholders($convertedString, $replacedStringsList, "`");
|
||||
$convertedString = self::replaceSectionsWithPlaceholders($convertedString, $replacedStringsList, "'");
|
||||
self::fixQuoteEscapingForSingleQuoteDelimitedStrings($replacedStringsList);
|
||||
$convertedString = self::unescapeSingleQuoteBetweenDoubleQuotes($convertedString);
|
||||
$convertedString = self::replaceSectionsWithPlaceholders($convertedString, $replacedStringsList, '"');
|
||||
// Now is safe to remove all white space
|
||||
$convertedString = preg_replace('/\s+/m', '', $convertedString);
|
||||
// And remove all trailing commas in objects
|
||||
$convertedString = str_replace([',}', ',]'], ['}', ']'], $convertedString);
|
||||
// Add double quotes for keys
|
||||
$convertedString = preg_replace('/([^{}\[\]#,]+):/', '"$1":', $convertedString);
|
||||
// Add double quotes for values
|
||||
$convertedString = preg_replace_callback(
|
||||
'/:([^{}\[\]#,]+)/',
|
||||
static function ($matches)
|
||||
{
|
||||
if (is_numeric($matches[1]))
|
||||
{
|
||||
return ':' . $matches[1];
|
||||
}
|
||||
|
||||
return ':"' . $matches[1] . '"';
|
||||
},
|
||||
$convertedString
|
||||
);
|
||||
// Make sure "true", "false" and "null" values get delimited by double quotes
|
||||
// Need to run the replacement twice, because not all values get replaced if they are adjacent
|
||||
$convertedString = preg_replace('/([^"])(true|false|null)([^"])/', '$1"$2"$3', $convertedString);
|
||||
$convertedString = preg_replace('/([^"])(true|false|null)([^"])/', '$1"$2"$3', $convertedString);
|
||||
// Replace the placeholders with the initial strings
|
||||
$deep = false;
|
||||
do
|
||||
{
|
||||
$convertedString = preg_replace_callback(
|
||||
'/###(\d+)###/',
|
||||
static function ($matches) use (&$replacedStringsList, $deep)
|
||||
{
|
||||
$replace = $replacedStringsList[$matches[1]];
|
||||
unset($replacedStringsList[$matches[1]]);
|
||||
return ($deep ? "'" . $replace . "'" : '"' . $replace . '"');
|
||||
},
|
||||
$convertedString
|
||||
);
|
||||
|
||||
$deep = true;
|
||||
} while (!empty($replacedStringsList));
|
||||
// Note: unquoting booleans is disabled for the sakes of this script only
|
||||
// $convertedString = preg_replace('/:(")(true|false|null)(")/', ':$2', $convertedString);
|
||||
return self::trimToBrackets($convertedString);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given JS object to JSON and json_decode it
|
||||
*
|
||||
* @param string $input
|
||||
* @return array|null
|
||||
*/
|
||||
public static function convertToArray(string $input): ?array
|
||||
{
|
||||
return json_decode(self::convertToJson($input), true);
|
||||
}
|
||||
|
||||
// remove (var/let/const) root declaration and trailing semicolon
|
||||
// so the output is really enclosed by curly brackets and no javascript
|
||||
// artefact remains
|
||||
public static function trimToBrackets(string $input): string
|
||||
{
|
||||
$input = trim($input);
|
||||
if($input[0] !== '{')
|
||||
{
|
||||
$input = substr($input, strpos($input, '{'));
|
||||
}
|
||||
if($input[-1] == ';' )
|
||||
$input[-1] = ' ';
|
||||
//echo $input;
|
||||
return trim($input);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all JS functions by counting the number of braces between open and
|
||||
* close (excl strings which should be placeholder-ed at this point).
|
||||
*
|
||||
* Removes shorthand and longhand functions whether they're single or multi-line:
|
||||
* key: (var) => 'Test',
|
||||
* key: var => 'Test',
|
||||
* key: () => 'Test',
|
||||
* key: () => { return 'Test'; },
|
||||
* key: (var) => {
|
||||
* return 'Test';
|
||||
* },
|
||||
* key: () => {
|
||||
* return 'Test';
|
||||
* },
|
||||
* key: () => {
|
||||
* if (complex) {
|
||||
* return 'Test';
|
||||
* }
|
||||
*
|
||||
* return 'Test';
|
||||
* },
|
||||
* key() {
|
||||
* return 'Test';
|
||||
* },
|
||||
*
|
||||
* @param string $input
|
||||
* @param boolean $debug (optional table view of the logic being broken down)
|
||||
* @return string
|
||||
*/
|
||||
protected static function removeFunctions(string $input, bool $debug = false): string
|
||||
{
|
||||
$functionLines = '/^(\s*)(?:([\'"]?\w+[\'"]?):\s*(function\s*\([^)]*\)\s*{|\s*(?:\([^)]*\)|[a-z0-9]+)\s*=>\s*)|[a-z0-9]+\([^)]*\)\s*{)/i';
|
||||
$lines = preg_split('/[\n\r]/', $input);
|
||||
|
||||
$delete = false;
|
||||
|
||||
$opens = 0;
|
||||
$closes = 0;
|
||||
$table = [];
|
||||
|
||||
foreach ($lines as $index => $line)
|
||||
{
|
||||
$row = [
|
||||
'line' => $line,
|
||||
'mode' => 'standard',
|
||||
'action' => 'Keep',
|
||||
'opens' => $opens,
|
||||
'closes' => $closes,
|
||||
];
|
||||
|
||||
if (preg_match($functionLines, $line))
|
||||
{
|
||||
$opens = substr_count($line, '{');
|
||||
$closes = substr_count($line, '}');
|
||||
|
||||
$row['mode'] = 'Start (found opens: ' . substr_count($line, '{') . ')';
|
||||
$row['opens'] = $opens;
|
||||
$row['closes'] = $closes;
|
||||
unset($lines[$index]);
|
||||
|
||||
if ($opens === $closes)
|
||||
{
|
||||
$row['action'] = 'Delete (Final)';
|
||||
}
|
||||
else
|
||||
{
|
||||
$delete = true;
|
||||
$row['action'] = 'Delete (Continue)';
|
||||
}
|
||||
|
||||
|
||||
$table[] = $row;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($delete)
|
||||
{
|
||||
$opens += substr_count($line, '{');
|
||||
$closes += substr_count($line, '}');
|
||||
|
||||
$row['opens'] = $opens;
|
||||
$row['closes'] = $closes;
|
||||
$row['action'] = 'Delete';
|
||||
|
||||
unset($lines[$index]);
|
||||
|
||||
if ($opens === $closes)
|
||||
{
|
||||
$row['action'] = 'Delete (Final)';
|
||||
$delete = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($debug)
|
||||
{
|
||||
$table[] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
if ($debug)
|
||||
{
|
||||
print '<table><tr><th>Index</th><th>Line</th><th>Mode</th><th>Action</th><th>Opens</th><th>Closes</th></tr>';
|
||||
|
||||
foreach ($table as $index => $row)
|
||||
{
|
||||
print '<tr>'
|
||||
. '<td>' . $index . '</td>'
|
||||
. '<td><pre>'. $row['line'] . '</pre></td>'
|
||||
. '<td>'. $row['mode'] . '</td>'
|
||||
. '<td>'. $row['action'] . '</td>'
|
||||
. '<td>'. $row['opens'] . '</td>'
|
||||
. '<td>'. $row['closes'] . '</td>'
|
||||
. '</tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
die();
|
||||
}
|
||||
|
||||
return implode("\n", $lines);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces sections enclosed by a specified delimiter with placeholders of form '###<PLACEHOLDER_INDEX>###'.
|
||||
*
|
||||
* @param string $input The string input
|
||||
* @param array $replacedSectionsList The replaced sections will be added to this array
|
||||
* @param string $delimiter The delimiter that encloses the sections (e.g. "'" - single quote)
|
||||
* @param bool $removeDelimitersFromSections Flag to remove or preserve the delimiters for the sections
|
||||
* @return string
|
||||
*/
|
||||
protected static function replaceSectionsWithPlaceholders(
|
||||
string $input,
|
||||
array &$replacedSectionsList,
|
||||
string $delimiter,
|
||||
bool $removeDelimitersFromSections = true
|
||||
): string
|
||||
{
|
||||
$output = $input[0];
|
||||
$sectionStartPos = $sectionEndPos = -1;
|
||||
$contentCopiedUntilPos = 0;
|
||||
|
||||
for ($i = 1; $i < strlen($input) - 1; $i++)
|
||||
{
|
||||
$char = $input[$i];
|
||||
$prevChar = $input[$i - 1];
|
||||
|
||||
if ($char === $delimiter && $prevChar !== '\\')
|
||||
{
|
||||
if ($sectionStartPos === -1)
|
||||
{
|
||||
$sectionStartPos = $i;
|
||||
}
|
||||
elseif ($sectionEndPos === -1)
|
||||
{
|
||||
$sectionEndPos = $i;
|
||||
}
|
||||
}
|
||||
|
||||
// If a section has been identified
|
||||
if ($sectionEndPos > -1)
|
||||
{
|
||||
$output .= substr($input, $contentCopiedUntilPos + 1, $sectionStartPos - $contentCopiedUntilPos - 1);
|
||||
|
||||
// Replace section with placeholder
|
||||
$output .= '###' . count($replacedSectionsList) . '###';
|
||||
|
||||
// Extract the section and add it to the replaced sections list
|
||||
if ($removeDelimitersFromSections)
|
||||
{
|
||||
$section = substr($input, $sectionStartPos + 1, $sectionEndPos - $sectionStartPos - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$section = substr($input, $sectionStartPos, $sectionEndPos - $sectionStartPos);
|
||||
}
|
||||
$replacedSectionsList[] = $section;
|
||||
|
||||
// Update relevant local vars
|
||||
$contentCopiedUntilPos = $sectionEndPos;
|
||||
$sectionStartPos = -1;
|
||||
$sectionEndPos = -1;
|
||||
}
|
||||
}
|
||||
|
||||
$output .= substr($input, $contentCopiedUntilPos + 1);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix the escaping for quotes inside strings that were initially delimited by single quotes.
|
||||
*
|
||||
* For example:
|
||||
* ```
|
||||
* 'string containing \' single quote' => "string containing ' single quote"
|
||||
* 'string containing " double quote' => "string containing \" double quote"
|
||||
* ```
|
||||
* @param array $strings
|
||||
*/
|
||||
protected static function fixQuoteEscapingForSingleQuoteDelimitedStrings(array &$strings): void
|
||||
{
|
||||
foreach ($strings as &$string)
|
||||
{
|
||||
// Escape contained double quotes
|
||||
$string = preg_replace('/([^\\\])"/', '$1\"', $string);
|
||||
// Unescape contained single quotes
|
||||
$string = preg_replace("/\\\\'/", "'", $string);
|
||||
}
|
||||
}
|
||||
|
||||
protected static function escapeSingleQuoteBetweenDoubleQuotes(string $jsonString): string
|
||||
{
|
||||
return preg_replace_callback(
|
||||
'/("[^\'"\n]*\'[^\'"\n]*")/',
|
||||
static function ($matches)
|
||||
{
|
||||
return str_replace("'", "\'", $matches[1]);
|
||||
},
|
||||
$jsonString
|
||||
);
|
||||
}
|
||||
|
||||
protected static function unescapeSingleQuoteBetweenDoubleQuotes(string $jsonString): string
|
||||
{
|
||||
return preg_replace_callback(
|
||||
'/("[^\'"\n]*\'[^\'"\n]*")/',
|
||||
static function ($matches)
|
||||
{
|
||||
return str_replace("\'", "'", $matches[1]);
|
||||
},
|
||||
$jsonString
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes single line comments (// ) from the given string.
|
||||
*
|
||||
* In order to avoid conflicts with URIs, the comments are only removed if the two forward slashes (//)
|
||||
* are immediately followed by a white space character.
|
||||
*
|
||||
* @param string $jsonString
|
||||
* @return string
|
||||
*/
|
||||
protected static function removeSingleLineComments(string $jsonString): string
|
||||
{
|
||||
return preg_replace("@//\s.*$@m", "", $jsonString);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
::@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
::DO_NOT_CHANGE::
|
||||
:: ============================================::
|
||||
set cvVersion=4.5.5
|
||||
echo Installing OpenCV-%cvVersion%
|
||||
:: ============================================::
|
||||
mkdir opencv-%cvVersion%
|
||||
cd opencv-%cvVersion%
|
||||
mkdir Installation
|
||||
set count=1
|
||||
set cwd=%cd%
|
||||
:: ============================================::
|
||||
echo Downloading opencv from github
|
||||
:: download latest opencv from git
|
||||
git clone https://github.com/opencv/opencv.git -b %cvVersion% --depth=1
|
||||
cd opencv
|
||||
:: checkout appropriate cv version
|
||||
:: git checkout %cvVersion%
|
||||
:: free some space on the disk
|
||||
rmdir -Force -Recurse .git
|
||||
|
||||
:: ============================================::
|
||||
echo Compiling using cmake
|
||||
|
||||
set cwd=%cd%
|
||||
|
||||
echo ============================================
|
||||
echo Building Debug version
|
||||
echo ============================================
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
:: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx::
|
||||
:: Configure OpenCV
|
||||
cmake -G "Visual Studio 17 2022" -T host=x64 -DCMAKE_INSTALL_PREFIX=%cwd%/Installation -D BUILD_opencv_java=OFF -D BUILD_opencv_python=OFF -D BUILD_EXAMPLES=OFF -D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=OFF ..
|
||||
::DO_NOT_CHANGE::
|
||||
::============================================::
|
||||
:: Compile OpenCV in release mode
|
||||
cmake.exe --build . --config Debug --target INSTALL
|
||||
cd ..
|
||||
cd ..
|
||||
cd ..
|
||||
@@ -0,0 +1,60 @@
|
||||
::@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
::============================================::
|
||||
set sdlVersion=2.0.22
|
||||
echo Installing SDL2-%sdlVersion%
|
||||
::============================================::
|
||||
::set count=1
|
||||
::============================================::
|
||||
|
||||
mkdir contrib
|
||||
|
||||
rem echo ============================================
|
||||
rem echo Downloading SDL2 for VisualC++
|
||||
rem echo ============================================
|
||||
rem
|
||||
rem curl https://libsdl.org/release/SDL2-devel-%sdlVersion%-VC.zip -o contrib/SDL2-VC.zip
|
||||
rem 7z x contrib/SDL2-VC.zip -ocontrib/MSVC/
|
||||
rem cp ".github/scripts/sdl2-config-vc.cmake" contrib/MSVC/SDL2-%sdlVersion%/sdl2-config.cmake
|
||||
rem
|
||||
rem echo ============================================
|
||||
rem echo Downloading SDL2 for mingw
|
||||
rem echo ============================================
|
||||
rem
|
||||
rem curl https://libsdl.org/release/SDL2-devel-%sdlVersion%-mingw.tar.gz -o contrib/SDL2-mingw.tar.gz
|
||||
rem 7z x contrib/SDL2-mingw.tar.gz -ocontrib/
|
||||
rem 7z x contrib/SDL2-mingw.tar -ocontrib/mingw/
|
||||
rem cp ".github/scripts/sdl2-config-mingw.cmake" contrib/mingw/SDL2-%sdlVersion%/sdl2-config.cmake
|
||||
rem
|
||||
rem ls contrib/src/
|
||||
rem ls contrib/MSVC/
|
||||
rem ls contrib/mingw/
|
||||
|
||||
echo ============================================
|
||||
echo Downloading SDL2 Source
|
||||
echo ============================================
|
||||
|
||||
curl https://www.libsdl.org/release/SDL2-%sdlVersion%.zip -o contrib/SDL2-SRC.zip
|
||||
7z x contrib/SDL2-SRC.zip -ocontrib/src/
|
||||
|
||||
|
||||
cd contrib/src/SDL2-%sdlVersion%
|
||||
|
||||
set cwd=%cd%
|
||||
|
||||
echo ============================================
|
||||
echo Building Debug version
|
||||
echo ============================================
|
||||
|
||||
:: build debug version
|
||||
cmake -S . -B build/debug -G "Visual Studio 17 2022" -T host=x64 -DCMAKE_INSTALL_PREFIX=%cwd%/install -DCMAKE_BUILD_TYPE=Debug
|
||||
cmake --build build/debug --target install
|
||||
|
||||
echo ============================================
|
||||
echo Building Release version
|
||||
echo ============================================
|
||||
|
||||
:: build release verion
|
||||
cmake -S . -B build/release -G "Visual Studio 17 2022" -T host=x64 -DCMAKE_INSTALL_PREFIX=%cwd%/install -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build build/release --target install
|
||||
|
||||
+172
@@ -0,0 +1,172 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
function patchpropertyfiles {
|
||||
|
||||
old_tag=$1
|
||||
new_tag=$2
|
||||
|
||||
echo "Patching property/json/tag files $old_tag => $new_tag"
|
||||
|
||||
if [ -f "$GITHUB_WORKSPACE/library.json" ]; then
|
||||
sed -i -e "s/\"$old_tag\"/\"$new_tag\"/g" $GITHUB_WORKSPACE/library.json
|
||||
cat $GITHUB_WORKSPACE/library.json
|
||||
fi
|
||||
|
||||
if [ -f "$GITHUB_WORKSPACE/library.properties" ]; then
|
||||
sed -i -e "s/version=$old_tag/version=$new_tag/g" $GITHUB_WORKSPACE/library.properties
|
||||
cat $GITHUB_WORKSPACE/library.properties
|
||||
fi
|
||||
|
||||
if [ -f "$GITHUB_WORKSPACE/src/gitTagVersion.h" ]; then
|
||||
# sed -i -e "s/\"$old_tag\"/\"$new_tag\"/g" $GITHUB_WORKSPACE/src/gitTagVersion.h
|
||||
|
||||
oldversionbits=( ${old_tag//./ } )
|
||||
oldmajorversion=${oldversionbits[0]//[!0-9]/};
|
||||
oldminorversion=${oldversionbits[1]//[!0-9]/};
|
||||
oldpatchversion=${oldversionbits[2]//[!0-9]/};
|
||||
|
||||
newversionbits=( ${new_tag//./ } )
|
||||
newmajorversion=${newversionbits[0]//[!0-9]/};
|
||||
newminorversion=${newversionbits[1]//[!0-9]/};
|
||||
newpatchversion=${newversionbits[2]//[!0-9]/};
|
||||
|
||||
sed -i -e "s/LGFX_VERSION_MAJOR $oldmajorversion/LGFX_VERSION_MAJOR $newmajorversion/g" $GITHUB_WORKSPACE/src/gitTagVersion.h
|
||||
sed -i -e "s/LGFX_VERSION_MINOR $oldminorversion/LGFX_VERSION_MINOR $newminorversion/g" $GITHUB_WORKSPACE/src/gitTagVersion.h
|
||||
sed -i -e "s/LGFX_VERSION_PATCH $oldpatchversion/LGFX_VERSION_PATCH $newpatchversion/g" $GITHUB_WORKSPACE/src/gitTagVersion.h
|
||||
|
||||
cat $GITHUB_WORKSPACE/src/gitTagVersion.h
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if [ $GITHUB_EVENT_NAME == "workflow_dispatch" ]; then
|
||||
|
||||
echo "Workflow dispatched event, guessing version from properties file"
|
||||
localtag=`cat $GITHUB_WORKSPACE/library.properties | grep version`
|
||||
RELEASE_TAG=${localtag//version=/ }
|
||||
minor=true
|
||||
|
||||
else
|
||||
|
||||
if [ ! $GITHUB_EVENT_NAME == "release" ]; then
|
||||
echo "Wrong event '$GITHUB_EVENT_NAME'!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
EVENT_JSON=`cat $GITHUB_EVENT_PATH`
|
||||
|
||||
action=`echo $EVENT_JSON | jq -r '.action'`
|
||||
if [ ! $action == "published" ]; then
|
||||
echo "Wrong action '$action'. Exiting now..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
draft=`echo $EVENT_JSON | jq -r '.release.draft'`
|
||||
if [ $draft == "true" ]; then
|
||||
echo "It's a draft release. Exiting now..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
RELEASE_PRE=`echo $EVENT_JSON | jq -r '.release.prerelease'`
|
||||
RELEASE_TAG=`echo $EVENT_JSON | jq -r '.release.tag_name'`
|
||||
RELEASE_BRANCH=`echo $EVENT_JSON | jq -r '.release.target_commitish'`
|
||||
RELEASE_ID=`echo $EVENT_JSON | jq -r '.release.id'`
|
||||
RELEASE_BODY=`echo $EVENT_JSON | jq -r '.release.body'`
|
||||
|
||||
echo "Event: $GITHUB_EVENT_NAME, Repo: $GITHUB_REPOSITORY, Path: $GITHUB_WORKSPACE, Ref: $GITHUB_REF"
|
||||
echo "Action: $action, Branch: $RELEASE_BRANCH, ID: $RELEASE_ID"
|
||||
echo "Tag: $RELEASE_TAG, Draft: $draft, Pre-Release: $RELEASE_PRE"
|
||||
|
||||
fi
|
||||
|
||||
|
||||
# Increment a version string using Semantic Versioning (SemVer) terminology.
|
||||
major=false;
|
||||
minor=false;
|
||||
patch=false;
|
||||
|
||||
while getopts ":MmpF:" Option
|
||||
do
|
||||
case $Option in
|
||||
M ) major=true;;
|
||||
m ) minor=true;;
|
||||
p ) patch=true;;
|
||||
F )
|
||||
version=${OPTARG}
|
||||
if [ "$version" == "auto" ]; then
|
||||
# default to patch
|
||||
patch=true
|
||||
else
|
||||
forcedversion=true
|
||||
echo "Forcing version to $version"
|
||||
fi
|
||||
;;
|
||||
* ) echo "NOTHING TO DO";;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ $OPTIND -eq 1 ]; then
|
||||
echo "No options were passed, assuming patch level"
|
||||
patch=true
|
||||
fi
|
||||
|
||||
|
||||
if [ -z ${RELEASE_TAG} ]
|
||||
then
|
||||
echo "Couldn't determine version"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
if [ "$forcedversion" != "true" ]; then
|
||||
|
||||
# Build array from version string.
|
||||
|
||||
a=( ${RELEASE_TAG//./ } )
|
||||
major_version=0
|
||||
# If version string is missing or has the wrong number of members, show usage message.
|
||||
|
||||
if [ ${#a[@]} -ne 3 ]; then
|
||||
echo "usage: $(basename $0) [-Mmp] major.minor.patch"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Increment version numbers as requested.
|
||||
|
||||
if [ $major == "true" ]; then
|
||||
echo "Raising MAJOR"
|
||||
# Check for v in version (e.g. v1.0 not just 1.0)
|
||||
if [[ ${a[0]} =~ ([vV]?)([0-9]+) ]]; then
|
||||
v="${BASH_REMATCH[1]}"
|
||||
major_version=${BASH_REMATCH[2]}
|
||||
((major_version++))
|
||||
a[0]=${v}${major_version}
|
||||
else
|
||||
((a[0]++))
|
||||
major_version=a[0]
|
||||
fi
|
||||
|
||||
a[1]=0
|
||||
a[2]=0
|
||||
fi
|
||||
|
||||
if [ $minor == "true" ]; then
|
||||
echo "Raising MINOR"
|
||||
((a[1]++))
|
||||
a[2]=0
|
||||
fi
|
||||
|
||||
if [ $patch == "true" ]; then
|
||||
echo "Raising PATCH"
|
||||
((a[2]++))
|
||||
fi
|
||||
|
||||
version=$(echo "${a[0]}.${a[1]}.${a[2]}")
|
||||
|
||||
fi
|
||||
|
||||
patchpropertyfiles $RELEASE_TAG $version
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
name: ArduinoBuild
|
||||
|
||||
env:
|
||||
SKETCH_NAME: build_test.ino
|
||||
|
||||
on:
|
||||
push: # see: https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
|
||||
paths:
|
||||
- '**.ino'
|
||||
- '**.cpp'
|
||||
- '**.hpp'
|
||||
- '**.h'
|
||||
- '**.c'
|
||||
- '**ArduinoBuild.yml'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: ${{matrix.board}}@${{matrix.platform-version}}
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
|
||||
platform-url:
|
||||
- https://espressif.github.io/arduino-esp32/package_esp32_index.json
|
||||
|
||||
board:
|
||||
# ESP32 devices for 3D matrix
|
||||
- esp32
|
||||
- esp32s2
|
||||
- m5stick-c
|
||||
- m5stack-core-esp32
|
||||
- m5stack-core2
|
||||
- esp32s3box
|
||||
|
||||
platform-version:
|
||||
# ESP32 Core versions for 3D matrix
|
||||
- 2.0.15
|
||||
- 2.0.16
|
||||
- 2.0.17
|
||||
#- 3.0.0
|
||||
|
||||
include:
|
||||
# 3D matrix doesn't apply to these:
|
||||
- { board: 'd1_mini:eesz=4M3M,xtal=80', platform: esp8266, archi: esp8266, platform-version: 3.0.1, platform-url: 'https://arduino.esp8266.com/stable/package_esp8266com_index.json', ... }
|
||||
- { board: 'd1_mini:eesz=4M3M,xtal=80', platform: esp8266, archi: esp8266, platform-version: 3.0.2, platform-url: 'https://arduino.esp8266.com/stable/package_esp8266com_index.json', ... }
|
||||
- { board: seeed_wio_terminal, platform: Seeeduino, archi: samd, platform-version: 1.8.2, platform-url: 'https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json', ... }
|
||||
- { board: adafruit_hallowing, platform: adafruit, archi: samd, platform-version: 1.7.10, platform-url: 'https://adafruit.github.io/arduino-board-index/package_adafruit_index.json', ... }
|
||||
- { board: adafruit_hallowing_m4, platform: adafruit, archi: samd, platform-version: 1.7.10, platform-url: 'https://adafruit.github.io/arduino-board-index/package_adafruit_index.json', ... }
|
||||
- { board: adafruit_pybadge_m4, platform: adafruit, archi: samd, platform-version: 1.7.10, platform-url: 'https://adafruit.github.io/arduino-board-index/package_adafruit_index.json', ... }
|
||||
- { board: adafruit_pygamer_m4, platform: adafruit, archi: samd, platform-version: 1.7.10, platform-url: 'https://adafruit.github.io/arduino-board-index/package_adafruit_index.json', ... }
|
||||
- { board: adafruit_feather_esp32s2_tft, platform: esp32, archi: esp32, platform-version: latest, platform-url: 'https://espressif.github.io/arduino-esp32/package_esp32_index.json', ... }
|
||||
- { board: adafruit_feather_esp32s3_tft, platform: esp32, archi: esp32, platform-version: latest, platform-url: 'https://espressif.github.io/arduino-esp32/package_esp32_index.json', ... }
|
||||
- { board: adafruit_funhouse_esp32s2, platform: esp32, archi: esp32, platform-version: latest, platform-url: 'https://espressif.github.io/arduino-esp32/package_esp32_index.json', ... }
|
||||
- { board: rpipico, platform: rp2040, archi: rp2040, platform-version: 2.3.3, cli-args: '--build-property compiler.cpp.extra_flags=-DSKIP_I2C_TEST', platform-url: 'https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json', ... }
|
||||
|
||||
- { board: esp32, platform: esp32, platform-version: latest, platform-url: 'https://espressif.github.io/arduino-esp32/package_esp32_index.json', archi: esp32, ... }
|
||||
- { board: esp32s2, platform: esp32, platform-version: latest, platform-url: 'https://espressif.github.io/arduino-esp32/package_esp32_index.json', archi: esp32, ... }
|
||||
- { board: esp32s3, platform: esp32, platform-version: latest, platform-url: 'https://espressif.github.io/arduino-esp32/package_esp32_index.json', archi: esp32, ... }
|
||||
- { board: esp32c6, platform: esp32, platform-version: latest, platform-url: 'https://espressif.github.io/arduino-esp32/package_esp32_index.json', archi: esp32, ... }
|
||||
- { board: esp32c3, platform: esp32, platform-version: latest, platform-url: 'https://espressif.github.io/arduino-esp32/package_esp32_index.json', archi: esp32, ... }
|
||||
# - { board: esp32h2, platform: esp32, platform-version: latest, platform-url: 'https://espressif.github.io/arduino-esp32/package_esp32_index.json', archi: esp32, ... }
|
||||
|
||||
# 3D matrix applies to these:
|
||||
- { platform: esp32, archi: esp32, ... }
|
||||
|
||||
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: Compile example
|
||||
uses: ArminJo/arduino-test-compile@master
|
||||
with:
|
||||
arduino-board-fqbn: ${{matrix.platform}}:${{matrix.archi}}:${{matrix.board}}
|
||||
arduino-platform: ${{matrix.platform}}:${{matrix.archi}}@${{matrix.platform-version}}
|
||||
platform-url: ${{ matrix.platform-url }}
|
||||
required-libraries: ${{ matrix.required-libraries }}
|
||||
extra-arduino-cli-args: ${{ matrix.cli-args }}
|
||||
#build-properties: ${{ toJson(matrix.build-properties) }}
|
||||
sketch-names: ${{ env.SKETCH_NAME }}
|
||||
#sketches-exclude: ${{ matrix.sketches-exclude }}
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
name: IDFBuild
|
||||
|
||||
|
||||
|
||||
env:
|
||||
REPO_URL: https://github.com/espressif/esp-idf
|
||||
PROJECT_DIR: examples/Test/build_test
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '**.ino'
|
||||
- '**.cpp'
|
||||
- '**.hpp'
|
||||
- '**.h'
|
||||
- '**.c'
|
||||
- '**IDFBuild.yml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'esp-idf-versions.php'
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
|
||||
set_matrix:
|
||||
name: Version planner ⊹
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
max-versions: 3 # maximum core versions to test, starting at latest
|
||||
outputs:
|
||||
matrix: ${{steps.set-matrix.outputs.matrix}}
|
||||
project_dir: ${{steps.set-matrix.outputs.project_dir}}
|
||||
repo_url: ${{steps.set-matrix.outputs.repo_url}}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: Setup matrix
|
||||
id: set-matrix
|
||||
run: |
|
||||
matrix=`php .github/scripts/esp-idf-versions.php`
|
||||
# echo $matrix | jq # debug
|
||||
matrix="${matrix//'%'/'%25'}" # escape percent entities
|
||||
matrix="${matrix//$'\n'/''}" # remove lf
|
||||
matrix="${matrix//$'\r'/''}" # remove cr
|
||||
echo "matrix=${matrix}" >> $GITHUB_OUTPUT
|
||||
echo "project_dir=${{env.PROJECT_DIR}}" >> $GITHUB_OUTPUT
|
||||
echo "repo_url=${{env.REPO_URL}}" >> $GITHUB_OUTPUT
|
||||
|
||||
build:
|
||||
name: idf ${{ matrix.esp-idf-fqbn }}
|
||||
needs: set_matrix
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix: ${{fromJSON(needs.set_matrix.outputs.matrix)}}
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
# - name: Cache pip for ${{ matrix.esp-idf-fqbn }}
|
||||
# uses: actions/cache@v3
|
||||
# with:
|
||||
# path: ~/.cache/pip
|
||||
# key: ${{ runner.os }}-pip-${{ matrix.esp-idf-fqbn }}-${{ hashFiles('**/requirements.txt') }}
|
||||
# restore-keys: |
|
||||
# ${{ runner.os }}-pip-
|
||||
#
|
||||
# - name: Cache espressif tools for ${{ matrix.esp-idf-fqbn }}
|
||||
# uses: actions/cache@v3
|
||||
# id: espressif
|
||||
# with:
|
||||
# path: |
|
||||
# ~/.espressif
|
||||
# key: ${{ runner.os }}-espressif-${{ matrix.esp-idf-fqbn }}-${{ hashFiles('**/lockfiles') }}
|
||||
#
|
||||
# - name: Cache esp-idf for ${{ matrix.esp-idf-fqbn }}
|
||||
# id: cache-idf
|
||||
# uses: actions/cache@v3
|
||||
# with:
|
||||
# path: ~/esp/esp-idf
|
||||
# key: ${{ runner.os }}-idf-${{ matrix.esp-idf-fqbn }}-${{ hashFiles('**/lockfiles') }}
|
||||
|
||||
- name: Get/Check IDF ${{ matrix.esp-idf-fqbn }}
|
||||
run: |
|
||||
mkdir -p ~/esp
|
||||
cd ~/esp
|
||||
idf_fqbn="${{ matrix.esp-idf-fqbn }}"
|
||||
idf_version=${idf_fqbn#*@}
|
||||
if [ ! -d "./esp-idf/" ]; then git clone -b v$idf_version --recursive ${{ needs.set_matrix.outputs.repo_url }} esp-idf; fi
|
||||
cd ~/esp/esp-idf
|
||||
if [ ! -d "~/.espressif" ]; then ./install.sh; fi
|
||||
|
||||
- name: Build example for ${{ matrix.esp-idf-fqbn }}
|
||||
run: |
|
||||
source ~/esp/esp-idf/export.sh
|
||||
idf_fqbn="${{ matrix.esp-idf-fqbn }}"
|
||||
idf_board=${idf_fqbn%%@*}
|
||||
cd ${{ needs.set_matrix.outputs.project_dir }}
|
||||
idf.py set-target $idf_board
|
||||
idf.py build
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
# OpenCVBuild.yml
|
||||
name: OpenCVBuild
|
||||
|
||||
env:
|
||||
PROJECT_DIR: examples_for_PC/CMake_OpenCV
|
||||
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '**.ino'
|
||||
- '**.cpp'
|
||||
- '**.hpp'
|
||||
- '**.h'
|
||||
- '**.c'
|
||||
- '**OpenCVBuild.yml'
|
||||
- '**OpenCV.cmake'
|
||||
- '**installOpenCV.bat'
|
||||
pull_request:
|
||||
|
||||
# workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
LGFXOpenCV:
|
||||
|
||||
name: LGFXOpenCV (${{ matrix.os }})
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
include:
|
||||
- { os: windows-latest, OpenCV_DIR: "D:/a/LovyanGFX/LovyanGFX/opencv-4.5.5/opencv/build/" }
|
||||
- { os: macos-latest, OpenCV_DIR: "/usr/local/Cellar/opencv/4.5.5_2/" }
|
||||
- { os: ubuntu-latest, OpenCV_DIR: "/home/runner/work/LovyanGFX/LovyanGFX/opencv-install/opencv/build" }
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 🪟 📦 Use GNU tar instead BSD tar
|
||||
if: matrix.os == 'windows-latest'
|
||||
shell: cmd
|
||||
run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"
|
||||
|
||||
- name: 🪟 📦 Cache OpenCV for Windows
|
||||
if: ${{ matrix.os == 'windows-latest' }}
|
||||
uses: actions/cache@v3
|
||||
id: cache-opencv-windows
|
||||
with:
|
||||
path: D:\a\LovyanGFX\LovyanGFX\opencv-4.5.5\
|
||||
key: ${{ matrix.os }}-opencv-cache
|
||||
|
||||
- name: 🪟 🏗️ Build+Install OpenCV for Windows
|
||||
if: matrix.os == 'windows-latest' && steps.cache-opencv-windows.outputs.cache-hit != 'true'
|
||||
shell: pwsh
|
||||
run: |
|
||||
.github/scripts/installOpenCV.bat
|
||||
Remove-Item -Recurse -Force ${{ matrix.OpenCV_DIR }}modules
|
||||
|
||||
- name: 🪟 🏗️ Build LGFXOpenCV example for Windows
|
||||
if: matrix.os == 'windows-latest'
|
||||
env:
|
||||
OpenCV_DIR: ${{ matrix.OpenCV_DIR }}
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
run: |
|
||||
Get-PSDrive
|
||||
cp .github/scripts/OpenCV.cmake ${{ env.PROJECT_DIR }}/CMakeLists.txt
|
||||
cd ${{ env.PROJECT_DIR }}
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "Visual Studio 17 2022" -A x64 -T ClangCL ..
|
||||
cmake --build . --config Debug
|
||||
|
||||
- name: 🐧 📦 Cache OpenCV for Linux
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
uses: actions/cache@v3
|
||||
id: cache-opencv-linux
|
||||
with:
|
||||
path: /home/runner/work/LovyanGFX/LovyanGFX/opencv-install
|
||||
key: ${{ matrix.os }}-opencv-cache
|
||||
|
||||
- name: 🐧 🏗️ Install OpenCV for Linux
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
uses: rayandrews/with-opencv-action@v1
|
||||
with:
|
||||
dir: /home/runner/work/LovyanGFX/LovyanGFX/opencv-install
|
||||
cached: ${{ steps.cache-opencv-linux.outputs.cache-hit }}
|
||||
BUILD_EXAMPLES: false
|
||||
INSTALL_C_EXAMPLES: false
|
||||
INSTALL_PYTHON_EXAMPLES: false
|
||||
opencv-version: '4.5.5'
|
||||
|
||||
|
||||
- name: 🍏 📦 🍺 Cache brew deps for MacOS
|
||||
if: matrix.os == 'macos-latest'
|
||||
uses: actions/cache@v3
|
||||
id: cache-opencv-macosx
|
||||
with:
|
||||
# Paths to cache:
|
||||
# /usr/local/Homebrew - installation folder of Homebrew
|
||||
# /usr/local/Cellar - installation folder of Homebrew formulae
|
||||
# /usr/local/Frameworks, /usr/local/bin, /usr/local/opt - contain (links to) binaries installed by Homebrew formulae
|
||||
# /usr/local/lib/python3.8 - Python3 packages installation
|
||||
path: |
|
||||
/usr/local/Homebrew
|
||||
/usr/local/Cellar
|
||||
/usr/local/Frameworks
|
||||
/usr/local/bin
|
||||
/usr/local/opt
|
||||
/usr/local/lib/python3.8
|
||||
key: ${{ matrix.os }}-opencv
|
||||
|
||||
- name: 🍏 🍺 Install OpenCV+CMake brew packages for MacOS
|
||||
if: matrix.os == 'macos-latest' && steps.cache-opencv-macosx.outputs.cache-hit != 'true'
|
||||
env:
|
||||
HOMEBREW_NO_AUTO_UPDATE: 1
|
||||
run: brew install opencv cmake
|
||||
|
||||
- name: 🐧/🍏 🏗️ Build LGFXOpenCV example for Linux/MacOS
|
||||
if: matrix.os != 'windows-latest'
|
||||
env:
|
||||
OpenCV_DIR: ${{ matrix.OpenCV_DIR }}
|
||||
run: |
|
||||
cp .github/scripts/OpenCV.cmake ${{ env.PROJECT_DIR }}/CMakeLists.txt
|
||||
cd ${{ env.PROJECT_DIR }}
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
cmake --build .
|
||||
@@ -0,0 +1,106 @@
|
||||
name: PlatformIOBuild
|
||||
|
||||
env:
|
||||
PROJECT_DIR: examples/Test/build_test
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '**.ino'
|
||||
- '**.cpp'
|
||||
- '**.hpp'
|
||||
- '**.h'
|
||||
- '**.c'
|
||||
- '**PlatformioBuild.yml'
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: ${{ matrix.board }}@${{ matrix.platform-version }}
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
|
||||
board:
|
||||
- esp32
|
||||
- esp32-s2
|
||||
- esp32-s3
|
||||
- esp32-c3
|
||||
- m5stick-c
|
||||
- m5stack-core-esp32
|
||||
- m5stack-core2
|
||||
- m5stack-cores3
|
||||
|
||||
platform-version:
|
||||
- 1.0.6
|
||||
- 2.0.11
|
||||
- 2.0.12
|
||||
- 2.0.13
|
||||
- default
|
||||
|
||||
exclude:
|
||||
- { board: esp32-c3, platform-version: 1.0.6 }
|
||||
- { board: esp32-s3, platform-version: 1.0.6 }
|
||||
- { board: esp32-s3, platform-version: default }
|
||||
- { board: esp32-s2, platform-version: 1.0.6 }
|
||||
- { board: m5stack-cores3, platform-version: 1.0.6 }
|
||||
|
||||
include:
|
||||
- board: esp32
|
||||
- board: esp32-s2
|
||||
- board: esp32-s3
|
||||
- board: esp32-c3
|
||||
- board: m5stick-c
|
||||
- board: m5stack-core-esp32
|
||||
- board: m5stack-core2
|
||||
- board: m5stack-cores3
|
||||
- { board: esp8266, platform-version: 4.2.1, ... }
|
||||
- { board: esp8266, platform-version: 4.2.0, ... }
|
||||
- { board: esp8266, platform-version: 4.1.0, ... }
|
||||
- { board: seeed_wio_terminal, platform-version: default, ... }
|
||||
- { board: adafruit_pybadge_m4, platform-version: default, ... }
|
||||
- { board: pico, platform-version: default, ... }
|
||||
- { board: native, platform-version: portduino, ... }
|
||||
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
- name: Cache PlatformIO
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.platformio
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.9'
|
||||
|
||||
- name: Install PlatformIO
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install --upgrade platformio
|
||||
|
||||
- name: Run PlatformIO
|
||||
|
||||
run: |
|
||||
cd ${{ env.PROJECT_DIR }}
|
||||
export pio_ver=${{ matrix.platform-version }}
|
||||
export pio_env="${pio_ver//./_}"
|
||||
pio pkg install -e ${{ matrix.board }}-$pio_env --no-save --library file://$(realpath ../../../)
|
||||
[[ "$pio_env" == "portduino" ]] && { sudo apt update; sudo apt-get install libgpiod-dev libbluetooth-dev; export PLATFORMIO_SRC_DIR=portduino; }
|
||||
pio run -e ${{ matrix.board }}-$pio_env
|
||||
@@ -0,0 +1,142 @@
|
||||
# SDLBuild.yml
|
||||
name: SDLBuild
|
||||
|
||||
env:
|
||||
PROJECT_DIR: examples_for_PC/CMake_SDL
|
||||
WASM_DIR: examples_for_PC/CMake_WASM
|
||||
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '**.ino'
|
||||
- '**.cpp'
|
||||
- '**.hpp'
|
||||
- '**.h'
|
||||
- '**.c'
|
||||
- '**SDLBuild.yml'
|
||||
- '**SDL.cmake'
|
||||
- '**installSDL2.bat'
|
||||
pull_request:
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
||||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
|
||||
LGFX_SDL2:
|
||||
|
||||
name: LGFX_SDL2 (${{ matrix.os }})
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
include:
|
||||
- { os: windows-latest }
|
||||
- { os: macos-12 }
|
||||
- { os: ubuntu-latest }
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
|
||||
- name: Cache SDL2 for Windows
|
||||
if: ${{ matrix.os == 'windows-latest' }}
|
||||
uses: actions/cache@v4
|
||||
id: cache-SLD2-windows
|
||||
with:
|
||||
path: contrib
|
||||
key: ${{ runner.os }}-${{ hashFiles('.github/scripts/installSDL2.bat') }}
|
||||
|
||||
- name: Build SDL2 for Windows
|
||||
if: matrix.os == 'windows-latest' && steps.cache-SLD2-windows.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
.github/scripts/installSDL2.bat
|
||||
|
||||
- name: Build LGFX_SDL2 for Windows
|
||||
if: ${{ matrix.os == 'windows-latest' }}
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
SDL2_DIR: D:/a/LovyanGFX/LovyanGFX/contrib/src/SDL2-2.0.22/install
|
||||
run: |
|
||||
cp .github/scripts/SDL.cmake ${{ env.PROJECT_DIR }}/CMakeLists.txt
|
||||
cd ${{ env.PROJECT_DIR }}
|
||||
cmake -S . -B build/debug -G "Visual Studio 17 2022" -A x64 -T ClangCL -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }}
|
||||
cmake --build build/debug --config Debug
|
||||
cmake -S . -B build/release -G "Visual Studio 17 2022" -A x64 -T ClangCL -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }}
|
||||
cmake --build build/release --config Release
|
||||
|
||||
|
||||
- name: Build LGFX_SDL2 for Linux
|
||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt-get install libsdl2-dev
|
||||
cp .github/scripts/SDL.cmake ${{ env.PROJECT_DIR }}/CMakeLists.txt
|
||||
cd ${{ env.PROJECT_DIR }}
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
cmake --build .
|
||||
|
||||
- name: Build LGFX_SDL2/WASM for Linux
|
||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||
run: |
|
||||
git clone https://github.com/emscripten-core/emsdk.git
|
||||
cd emsdk
|
||||
./emsdk install latest # any specific version?
|
||||
./emsdk activate latest
|
||||
source ./emsdk_env.sh
|
||||
cd ..
|
||||
cd ${{env.WASM_DIR}}
|
||||
mkdir build
|
||||
cd build
|
||||
emcmake cmake ..
|
||||
emmake make
|
||||
mkdir -p www/WASM
|
||||
cp index.html www/WASM/index.html
|
||||
|
||||
- name: Upload WASM artifact
|
||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: ${{env.WASM_DIR}}/build/www
|
||||
|
||||
|
||||
- name: Build LGFX_SDL2 for Mac
|
||||
if: ${{ matrix.os == 'macos-12' }}
|
||||
run: |
|
||||
brew install sdl2
|
||||
cp .github/scripts/SDL.cmake ${{ env.PROJECT_DIR }}/CMakeLists.txt
|
||||
cd ${{ env.PROJECT_DIR }}
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
cmake --build .
|
||||
|
||||
|
||||
deploy:
|
||||
name: Deploy WASM Example 🚀
|
||||
if: github.ref == 'refs/heads/master'
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: LGFX_SDL2
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v2
|
||||
@@ -0,0 +1,31 @@
|
||||
name: ArduinoCIBuild
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: install python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.8'
|
||||
|
||||
- name: install platformio
|
||||
run: |
|
||||
pip install platformio==5.0.3
|
||||
|
||||
- name: perform chmod
|
||||
run: chmod +x ./.github/scripts/ci-compile
|
||||
|
||||
- name: build examples
|
||||
run: ./.github/scripts/ci-compile
|
||||
@@ -0,0 +1,16 @@
|
||||
on:
|
||||
issues:
|
||||
types: [opened, edited]
|
||||
|
||||
jobs:
|
||||
auto_close_issues:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Automatically close issues that do not follow the issue template
|
||||
uses: lucasbento/auto-close-issues@v1.0.2
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-close-message: "Hello! :wave:\n\nThis issue is being automatically closed because it does not follow the issue template." # optional property
|
||||
closed-issues-label: "🙁 Not following issue template" # optional property
|
||||
@@ -0,0 +1,42 @@
|
||||
name: pioPkgPublish
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
- name: Cache PlatformIO
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.platformio
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
|
||||
- name: Install PlatformIO
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install --upgrade platformio
|
||||
|
||||
- name: Run PlatformIO
|
||||
env:
|
||||
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}
|
||||
run: |
|
||||
pio package publish --owner lovyan03 --non-interactive
|
||||
@@ -0,0 +1,28 @@
|
||||
name: Stale
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [reopened]
|
||||
schedule:
|
||||
- cron: '*/60 * * * *'
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
ACTIONS_STEP_DEBUG: true
|
||||
steps:
|
||||
- uses: actions/stale@v9.0.0
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
|
||||
stale-pr-message: 'This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
|
||||
stale-issue-label: 'stale'
|
||||
stale-pr-label: 'stale'
|
||||
days-before-stale: 30
|
||||
days-before-close: 7
|
||||
exempt-issue-labels: 'pinned'
|
||||
exempt-pr-labels: 'device support request,bug'
|
||||
remove-stale-when-updated: true
|
||||
close-issue-message: 'This issue has been automatically closed because it has not had recent activity. Thank you for your contributions.'
|
||||
close-pr-message: 'This pull request has been automatically closed because it has not had recent activity. Thank you for your contributions.'
|
||||
Reference in new issue
Block a user