-
-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into main
- Loading branch information
Showing
42 changed files
with
1,333 additions
and
203 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
name: CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
erc-drc-checks: | ||
runs-on: ubuntu-latest | ||
if: github.ref_type != 'tag' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: INTI-CMNB/KiBot@v2_k6 | ||
with: | ||
config: Hardware/OpenMowerMainboard/OpenMowerMainboard.kibot.yaml | ||
board: Hardware/OpenMowerMainboard/OpenMowerMainboard.kicad_pcb | ||
verbose: 1 | ||
|
||
firmware: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Cache PlatformIO | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.platformio | ||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
- name: Install PlatformIO | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade platformio | ||
- name: Run PlatformIO | ||
run: pio run -d Firmware/LowLevel | ||
- name: Copy Artifacts | ||
run: | | ||
mkdir artifacts | ||
mkdir ./artifacts/ELFLEIN_PROTOTYPE | ||
cp Firmware/LowLevel/.pio/build/ELFLEIN_PROTOTYPE/firmware.elf ./artifacts/ELFLEIN_PROTOTYPE | ||
cp Firmware/LowLevel/.pio/build/ELFLEIN_PROTOTYPE/firmware.uf2 ./artifacts/ELFLEIN_PROTOTYPE | ||
mkdir ./artifacts/MPU9250 | ||
cp Firmware/LowLevel/.pio/build/MPU9250/firmware.elf ./artifacts/MPU9250 | ||
cp Firmware/LowLevel/.pio/build/MPU9250/firmware.uf2 ./artifacts/MPU9250 | ||
mkdir ./artifacts/WT901_INSTEAD_OF_SOUND | ||
cp Firmware/LowLevel/.pio/build/WT901_INSTEAD_OF_SOUND/firmware.elf ./artifacts/WT901_INSTEAD_OF_SOUND | ||
cp Firmware/LowLevel/.pio/build/WT901_INSTEAD_OF_SOUND/firmware.uf2 ./artifacts/WT901_INSTEAD_OF_SOUND | ||
- name: Step 3 - Use the Upload Artifact GitHub Action | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: open-mower-pico-firmware | ||
path: artifacts/ | ||
|
||
tagged-release: | ||
runs-on: ubuntu-latest | ||
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v') | ||
needs: firmware | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: INTI-CMNB/KiBot@v2_k6 | ||
with: | ||
config: Hardware/OpenMowerMainboard/OpenMowerMainboard.kibot.yaml | ||
board: Hardware/OpenMowerMainboard/OpenMowerMainboard.kicad_pcb | ||
skip: run_drc,run_erc | ||
|
||
- name: 'Fix permissions on release/' | ||
run: sudo chmod 0777 release | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: open-mower-pico-firmware | ||
path: firmware | ||
|
||
- name: Create firmware zip | ||
run: zip -r release/firmware.zip firmware | ||
|
||
- uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
prerelease: false | ||
files: release/* | ||
|
||
- name: Deploy release | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: release | ||
destination_dir: release | ||
|
||
- name: Deploy release_navigator | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: release_navigator | ||
destination_dir: release_navigator | ||
keep_files: true | ||
|
||
- name: Deploy release_navigator index | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: release_navigator | ||
keep_files: true |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
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,72 @@ | ||
// Created by Elmar Elflein on 18/07/22. | ||
// Copyright (c) 2022 Elmar Elflein. All rights reserved. | ||
// | ||
// This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. | ||
// | ||
// Feel free to use the design in your private/educational projects, but don't try to sell the design or products based on it without getting my consent first. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
// | ||
// | ||
#ifndef _SOUND_SYSTEM_H_ | ||
#define _SOUND_SYSTEM_H_ | ||
|
||
//#include <Arduino.h> | ||
#include <stdint.h> | ||
#include <list> | ||
|
||
#include <pins.h> | ||
#include <DFPlayerMini_Fast.h> | ||
#include <soundsystem.h> | ||
|
||
|
||
#define BUFFERSIZE 100 | ||
|
||
#define NR_SOUNDFILES 15 // Number of Soundfiles on SD-card | ||
|
||
|
||
|
||
class MP3Sound | ||
{ | ||
|
||
|
||
|
||
|
||
public: | ||
|
||
uint32_t anzSoundfiles; // number of files stored on the SD-card | ||
bool playing; | ||
|
||
MP3Sound(); | ||
|
||
bool begin(int anzsoundsOnSD); // init serial stream and soundmodule, anzsoundOnSD : maximum number of available soundfiles on the SD-card | ||
|
||
void playSound(int soundNr); // play soundfile number. This method writes soundfile nr in a list, the method processSounds() (has to run in loop) will play | ||
// the sounds according to the list | ||
|
||
void playSoundAdHoc(int soundNr); // play soundfile number immediately whithout waiting until the end of sound | ||
|
||
void setvolume(int vol); // scales loudness from 0 to 100 % | ||
|
||
int sounds2play(); // returns the number if sounds to play in the list | ||
|
||
int processSounds(); // play all sounds from the list. This method has to be calles cyclic, e.g. every second. | ||
|
||
|
||
private: | ||
std::list <int> active_sounds; | ||
bool sound_available; | ||
|
||
|
||
|
||
|
||
}; | ||
|
||
|
||
#endif // _SOUND_SYSTEM_H_ HEADER_FILE |
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,110 @@ | ||
#include "JY901.h" | ||
#include "string.h" | ||
|
||
CJY901 ::CJY901(HardwareSerial *serial) | ||
{ | ||
this->serial = serial; | ||
} | ||
|
||
void CJY901::begin(int baudrate) { | ||
serial->begin(baudrate); | ||
delay(1000); | ||
uint8_t unlock[] = {0xFF,0xF0,0xF0,0xF0,0xF0}; | ||
serial->write(unlock, 5); | ||
serial->flush(); | ||
delay(10); | ||
writeRegister(RSW, 0b0000000000010110); | ||
delay(10); | ||
writeRegister(RRATE, 0x09); | ||
delay(10); | ||
writeRegister(0x0b,0x00); | ||
delay(10); | ||
writeRegister(0x0c,0x00); | ||
delay(10); | ||
writeRegister(0x0d,0x00); | ||
delay(10); | ||
|
||
|
||
|
||
|
||
ucRxCnt = 0; | ||
} | ||
|
||
void CJY901 ::update() | ||
{ | ||
while (serial->available()) | ||
{ | ||
|
||
ucRxBuffer[ucRxCnt++] = serial->read(); | ||
if (ucRxBuffer[0] != 0x55) | ||
{ | ||
ucRxCnt = 0; | ||
continue; | ||
} | ||
if (ucRxCnt < 11) | ||
{ | ||
continue; | ||
} | ||
else | ||
{ | ||
switch (ucRxBuffer[1]) | ||
{ | ||
case 0x50: | ||
memcpy(&stcTime, &ucRxBuffer[2], 8); | ||
break; | ||
case 0x51: | ||
memcpy(&stcAcc, &ucRxBuffer[2], 8); | ||
break; | ||
case 0x52: | ||
memcpy(&stcGyro, &ucRxBuffer[2], 8); | ||
break; | ||
case 0x53: | ||
memcpy(&stcAngle, &ucRxBuffer[2], 8); | ||
break; | ||
case 0x54: | ||
memcpy(&stcMag, &ucRxBuffer[2], 8); | ||
break; | ||
case 0x55: | ||
memcpy(&stcDStatus, &ucRxBuffer[2], 8); | ||
break; | ||
case 0x56: | ||
memcpy(&stcPress, &ucRxBuffer[2], 8); | ||
break; | ||
case 0x57: | ||
memcpy(&stcLonLat, &ucRxBuffer[2], 8); | ||
break; | ||
case 0x58: | ||
memcpy(&stcGPSV, &ucRxBuffer[2], 8); | ||
break; | ||
} | ||
ucRxCnt = 0; | ||
} | ||
} | ||
} | ||
|
||
void CJY901::writeRegister(uint8_t address, uint16_t data) { | ||
uint8_t unlock[] = {0xFF,0xAA,0x69,0x88,0xB5}; | ||
serial->write(unlock, 5); | ||
serial->flush(); | ||
delay(100); | ||
|
||
uint8_t buffer[6]; | ||
buffer[0] = 0xFF; | ||
buffer[1] = 0xAA; | ||
buffer[2] = address; | ||
buffer[3] = data & 0xFF; | ||
buffer[4] = (data >> 8) & 0xFF; | ||
|
||
serial->write(buffer, 5); | ||
serial->flush(); | ||
|
||
serial->write(unlock, 5); | ||
serial->flush(); | ||
delay(100); | ||
|
||
uint8_t save[] = {0xFF,0xAA,0x00,0x00,0x00}; | ||
serial->write(save, 5); | ||
serial->flush(); | ||
delay(100); | ||
|
||
} |
Oops, something went wrong.