forked from hoylabs/OpenDTU-OnBattery
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge development into master
- Loading branch information
Showing
244 changed files
with
12,573 additions
and
8,175 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: OpenDTU-onBattery Build | ||
name: OpenDTU-OnBattery Build | ||
|
||
on: | ||
push: | ||
|
@@ -8,7 +8,7 @@ on: | |
branches: | ||
- master | ||
- development | ||
tags-ignore: | ||
tags-ignore: | ||
- 'v**' | ||
pull_request: | ||
paths-ignore: | ||
|
@@ -120,6 +120,7 @@ jobs: | |
name: opendtu-onbattery-${{ matrix.environment }} | ||
path: | | ||
.pio/build/${{ matrix.environment }}/opendtu-onbattery-${{ matrix.environment }}.bin | ||
!.pio/build/generic_esp32_4mb_no_ota/opendtu-onbattery-generic_esp32_4mb_no_ota.bin | ||
.pio/build/${{ matrix.environment }}/opendtu-onbattery-${{ matrix.environment }}.factory.bin | ||
release: | ||
|
@@ -130,14 +131,14 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get tags | ||
run: git fetch --force --tags origin | ||
|
||
- name: Get openDTU core release | ||
run: | | ||
echo "OPEN_DTU_CORE_RELEASE=$(git for-each-ref --sort=creatordate --format '%(refname) %(creatordate)' refs/tags | grep 'refs/tags/v' | tail -1 | sed 's#.*/##' | sed 's/ .*//')" >> $GITHUB_ENV | ||
- name: Create openDTU-core-release-Badge | ||
uses: schneegans/[email protected] | ||
with: | ||
|
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
#pragma once | ||
|
||
#include "Battery.h" | ||
#include <driver/twai.h> | ||
#include <Arduino.h> | ||
|
||
class BatteryCanReceiver : public BatteryProvider { | ||
public: | ||
bool init(bool verboseLogging, char const* providerName); | ||
void deinit() final; | ||
void loop() final; | ||
|
||
virtual void onMessage(twai_message_t rx_message) = 0; | ||
|
||
protected: | ||
uint8_t readUnsignedInt8(uint8_t *data); | ||
uint16_t readUnsignedInt16(uint8_t *data); | ||
int16_t readSignedInt16(uint8_t *data); | ||
uint32_t readUnsignedInt32(uint8_t *data); | ||
float scaleValue(int16_t value, float factor); | ||
bool getBit(uint8_t value, uint8_t bit); | ||
|
||
bool _verboseLogging = true; | ||
|
||
private: | ||
char const* _providerName = "Battery CAN"; | ||
}; |
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.