Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix compilation on esp32 #4

Merged
merged 19 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
|
# Install arduino AVR
arduino-cli core install arduino:avr
arduino-cli core install arduino:esp32
# Install dependencies
libs=$(cat library.properties | grep depends | sed 's/depends=//g')
IFS=',' read -ra lib <<< "$libs"
Expand All @@ -37,3 +38,4 @@ jobs:
|
# Perform test compile
arduino-cli compile tests --fqbn arduino:avr:uno --log --library . --clean
arduino-cli compile tests --fqbn arduino:esp32:nano_nora --log --library . --clean
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Leaphy Extensions
version=1.0.1
version=1.0.2
author=Leaphy Robotics
maintainer=Leaphy Robotics <[email protected]>
sentence=Provides functionality to program all Leaphy robots
Expand All @@ -9,5 +9,5 @@ url=https://github.com/leaphy-robotics/leaphy-extensions
architectures=avr
# Only include actually used library code in the resulting executable
dot_a_linkage=true
depends=Adafruit SSD1306,Adafruit GFX Library,Adafruit LSM303 Accel,Adafruit LIS2MDL,Adafruit BusIO,Adafruit_VL53L0X,Adafruit NeoPixel
depends=Adafruit SSD1306,Adafruit GFX Library,Adafruit LSM303 Accel,Adafruit LIS2MDL,Adafruit BusIO,Adafruit_VL53L0X,Adafruit NeoPixel,EspSoftwareSerial

48 changes: 0 additions & 48 deletions src/LSM303AGR.cpp

This file was deleted.

26 changes: 0 additions & 26 deletions src/LSM303AGR.h

This file was deleted.

2 changes: 1 addition & 1 deletion src/Leaphyoriginal1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// suitable for Fundumoto Shield
// Copyright Science4Kids& Stichting Leaphy 2018
// version 1.0.0 25 JULI 2018

#include "Leaphyoriginal1.h"


Expand Down Expand Up @@ -100,3 +99,4 @@ void setLed(int fpRed, int fpGreen, int fpBlue)
analogWrite(LED1_GREEN, fpGreen);
analogWrite(LED1_BLUE, fpBlue);
}

1 change: 0 additions & 1 deletion src/Leaphyoriginal1.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#ifndef F_CPU
#define F_CPU 16000000UL
#endif
#include <util/delay.h>
#include <stdint.h>
#include <stdlib.h>

Expand Down
8 changes: 8 additions & 0 deletions src/RedMP3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,18 @@
#include <SoftwareSerial.h>
#include "RedMP3.h"

#ifdef AVR
MP3::MP3(uint8_t rxd, uint8_t txd):myMP3(txd, rxd)
{
myMP3.begin(9600);//baud rate is 9600bps
}
#else
MP3::MP3(uint8_t rxd, uint8_t txd)
{
myMP3.begin(9600, SWSERIAL_8N1, txd, rxd, false);//baud rate is 9600bps
}
#endif

void MP3::begin()
{
sendCommand(CMD_SEL_DEV, DEV_TF);//select the TF card
Expand Down
4 changes: 4 additions & 0 deletions src/RedMP3.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ class MP3
void playCombine(int16_t folderAndIndex[], int8_t number);

private:
#ifdef AVR
SoftwareSerial myMP3;
#else
EspSoftwareSerial::UART myMP3;
#endif
void sendCommand(int8_t command, int16_t dat = 0);
void mp3Basic(int8_t command);
void mp3_5bytes(int8_t command, uint8_t dat);
Expand Down