Skip to content

Commit

Permalink
Merge pull request #63 from meganetaaan/feature/m5stack_core2
Browse files Browse the repository at this point in the history
Add M5Stack Core2
  • Loading branch information
meganetaaan committed May 16, 2021
2 parents d2dd710 + 715fe61 commit 9fc75ee
Show file tree
Hide file tree
Showing 16 changed files with 81 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.pio/
.pioenvs
.piolibdeps
.vscode/.browse.c_cpp.db*
Expand All @@ -6,6 +7,7 @@
.vscode/settings.json
lib/aqtkpico_esp32
lib/aquestalk_esp32
lib/aquestalk-esp32
src/*.ino
const.h
/tmp/
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

language: python
python:
- "2.7"
- "3.8"

sudo: false
cache:
Expand Down
12 changes: 6 additions & 6 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
]
}
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
]
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Video: https://www.youtube.com/watch?v=C1Hj9kfY5qc
* :kiss: Lip sync
* :art: Color Palette
* :arrows_clockwise: Move, Zoom and Rotation
* :two: Compatible with M5Stack Core2

## Installation

Expand Down Expand Up @@ -53,6 +54,7 @@ platformio lib install M5Stack-Avatar
```cpp

#include <M5Stack.h>
// #include <M5Core2.h> // When using M5Stack Core2
#include <Avatar.h>

using namespace m5avatar;
Expand Down Expand Up @@ -83,6 +85,7 @@ void loop()
```cpp
#include <AquesTalkTTS.h>
#include <M5Stack.h>
// #include <M5Core2.h> // When using M5Stack Core2
#include <Avatar.h>
#include <tasks/LipSync.h>

Expand Down
4 changes: 3 additions & 1 deletion README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* :kiss: リップシンク(音声に合わせて口を動かす)できます。
* :art: 色を変更できます。
* :arrows_clockwise: 顔を移動、拡大、回転できます。
* :two: M5Stack Core2に対応。

## インストール

Expand All @@ -43,7 +44,6 @@ platformio init -d . -b m5stack-core-esp32
```
* cliからライブラリをインストールします。
```sh
platformio lib install M5Stack
platformio lib install M5Stack-Avatar
```
* ライブラリがプロジェクトの.piolibdeps配下にダウンロードされ、使用可能になります。
Expand All @@ -53,6 +53,7 @@ platformio lib install M5Stack-Avatar
```cpp

#include <M5Stack.h>
// #include <M5Core2.h> // M5Stack Core2の場合はこちらを使う
#include <Avatar.h>

using namespace m5avatar;
Expand Down Expand Up @@ -83,6 +84,7 @@ void loop()
```cpp
#include <AquesTalkTTS.h>
#include <M5Stack.h>
// #include <M5Core2.h> // M5Stack Core2の場合はこちらを使う
#include <Avatar.h>
#include <tasks/LipSync.h>

Expand Down
10 changes: 6 additions & 4 deletions build-example.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# 実行時に指定された引数の数、つまり変数 $# の値が 3 でなければエラー終了。
if [ $# -ne 1 ]; then
echo "usage: build-example.sh example-name" 1>&2
#!/bin/bash

if [ $# -lt 1 ]; then
echo "usage: build-example.sh example-name [options]" 1>&2
exit 1
fi
rm ./src/*.ino
cp ./examples/$1/$1.ino ./src/
platformio run --target upload
shift
platformio run --target upload $@
2 changes: 2 additions & 0 deletions examples/basics/basics.ino
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Include either M5Stack.h or M5Core2.h
// #include <M5Core2.h>
#include <M5Stack.h>
#include <Avatar.h>

Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"name": "M5Stack",
"version": ">=0.2.0"
},
"version": "0.7.2",
"version": "0.7.3",
"frameworks": "arduino",
"platforms": "espressif32"
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=M5Stack_Avatar
version=0.7.2
version=0.7.3
author=Shinya Ishikawa
maintainer=Shinya Ishikawa<[email protected]>
sentence=Yet another avatar module for M5Stack
Expand Down
28 changes: 25 additions & 3 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,31 @@
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html

[env:m5stack-core-esp32]
[platformio]
default_envs = m5stack-core

[env]
platform = espressif32
board = m5stack-core-esp32
framework = arduino
build_flags = -Llib/aquestalk_esp32 -lgcc -lopenssl -lbtdm_app -lfatfs -lwps -lcoexist -lwear_levelling -lhal -lnewlib -ldriver -lbootloader_support -lpp -lsmartconfig -ljsmn -lwpa -lethernet -lphy -lapp_trace -lconsole -lulp -lwpa_supplicant -lfreertos -lbt -lmicro-ecc -lcxx -lxtensa-debug-module -lmdns -lvfs -lsoc -lcore -lsdmmc -lcoap -ltcpip_adapter -lc_nano -lrtc -lspi_flash -lwpa2 -lesp32 -lapp_update -lnghttp -lspiffs -lespnow -lnvs_flash -lesp_adc_cal -llog -lexpat -lm -lc -lheap -lmbedtls -llwip -lnet80211 -lpthread -ljson -lstdc++ -laquestalk
monitor_speed = 115200

[env:m5stack-core]
board = m5stack-core-esp32
lib_deps = m5stack/M5Stack

[env:m5stack-core-with-aquestalk]
board = m5stack-core-esp32
lib_deps = m5stack/M5Stack
build_flags =
-laquestalk
-Llib/aquestalk-esp32/src/esp32

[env:m5stack-fire]
board = m5stack-fire
lib_deps = m5stack/M5Stack

[env:m5stack-core2]
board = m5stack-fire
build_flags = -D M5AVATAR_CORE2
lib_deps =
https://github.com/m5stack/M5Core2.git
6 changes: 5 additions & 1 deletion src/Balloon.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

#ifndef BALLOON_H_
#define BALLOON_H_
#include <M5Stack.h>
# if defined(ARDUINO_M5STACK_Core2) || defined(M5AVATAR_CORE2) || defined(_M5Core2_H_)
#include <M5Core2.h>
# else
#include <M5Stack.h>
# endif
#include "DrawContext.h"
#include "Drawable.h"

Expand Down
6 changes: 5 additions & 1 deletion src/ColorPalette.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

#ifndef COLORPALETTE_H_
#define COLORPALETTE_H_
#include <M5Stack.h>
# if defined(ARDUINO_M5STACK_Core2) || defined(M5AVATAR_CORE2) || defined(_M5Core2_H_)
#include <M5Core2.h>
# else
#include <M5Stack.h>
# endif
#include <string>
#include <map>
#define COLOR_PRIMARY "primary"
Expand Down
7 changes: 6 additions & 1 deletion src/faces/BMPFace.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
#ifndef FACES_BMPFACE_H_
#define FACES_BMPFACE_H_

#include <M5Stack.h> // TODO(meganetaaan): include only the Sprite function not a whole library
# if defined(ARDUINO_M5STACK_Core2) || defined(M5AVATAR_CORE2) || defined(_M5Core2_H_)
#include <M5Core2.h>
# else
#include <M5Stack.h> // TODO(meganetaaan): include only the Sprite function not a whole library
# endif

#include "../BoundingRect.h"
#include "../DrawContext.h"
#include "../Drawable.h"
Expand Down
6 changes: 5 additions & 1 deletion src/faces/DogFace.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
#ifndef FACES_DOGFACE_H_
#define FACES_DOGFACE_H_

#include <M5Stack.h> // TODO(meganetaaan): include only the Sprite function not a whole library
# if defined(ARDUINO_M5STACK_Core2) || defined(M5AVATAR_CORE2) || defined(_M5Core2_H_)
#include <M5Core2.h>
# else
#include <M5Stack.h> // TODO(meganetaaan): include only the Sprite function not a whole library
# endif
#include "../BoundingRect.h"
#include "../DrawContext.h"
#include "../Drawable.h"
Expand Down
6 changes: 5 additions & 1 deletion src/faces/OledFace.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
#ifndef FACES_OLEDFACE_H_
#define FACES_OLEDFACE_H_

#include <M5Stack.h> // TODO(meganetaaan): include only the Sprite function not a whole library
# if defined(ARDUINO_M5STACK_Core2) || defined(M5AVATAR_CORE2) || defined(_M5Core2_H_)
#include <M5Core2.h>
# else
#include <M5Stack.h> // TODO(meganetaaan): include only the Sprite function not a whole library
# endif
#include "../BoundingRect.h"
#include "../DrawContext.h"
#include "../Drawable.h"
Expand Down
6 changes: 5 additions & 1 deletion src/tasks/LipSync.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
#define TASKS_LIPSYNC_H_

#include <AquesTalkTTS.h>
#include <M5Stack.h>
# if defined(ARDUINO_M5STACK_Core2) || defined(M5AVATAR_CORE2)
#include <M5Core2.h>
# else
#include <M5Stack.h>
# endif
#include <Arduino.h>
#include "../Avatar.h"

Expand Down

0 comments on commit 9fc75ee

Please sign in to comment.