Compare commits
8 commits
e9eb537eee
...
674594d32e
Author | SHA1 | Date | |
---|---|---|---|
|
674594d32e | ||
|
548d4eeaa0 | ||
|
fdd9166e8e | ||
|
c82f162115 | ||
|
5c5033898d | ||
|
049de947fd | ||
|
b56ad43a59 | ||
|
54d7eb9277 |
10 changed files with 40 additions and 12 deletions
|
@ -6,6 +6,9 @@ steps:
|
|||
- name: build
|
||||
image: espressif/idf:release-v4.1
|
||||
commands:
|
||||
- mkdir ~/.ssh
|
||||
- ssh-keyscan -t rsa git.oit.cloud >> ~/.ssh/known_hosts
|
||||
- git submodule update --init
|
||||
- if [ -f sdkconfig ]; then
|
||||
- rm sdkconfig
|
||||
- fi
|
||||
|
|
6
.gitmodules
vendored
6
.gitmodules
vendored
|
@ -1,3 +1,3 @@
|
|||
[submodule "components/esp32-lora"]
|
||||
path = components/esp32-lora
|
||||
url = https://gitlab.com/morganrallen/esp32-lora.git
|
||||
[submodule "components/idf-dfplayermini"]
|
||||
path = components/idf-dfplayermini
|
||||
url = https://git.oit.cloud/morgan/idf-dfplayermini.git
|
||||
|
|
17
.woodpecker.yml
Normal file
17
.woodpecker.yml
Normal file
|
@ -0,0 +1,17 @@
|
|||
pipeline:
|
||||
build:
|
||||
image: espressif/idf:release-v4.1
|
||||
commands:
|
||||
- mkdir ~/.ssh
|
||||
- ssh-keyscan -t rsa git.oit.cloud >> ~/.ssh/known_hosts
|
||||
- git submodule update --init
|
||||
- if [ -f sdkconfig ]; then
|
||||
- rm sdkconfig
|
||||
- fi
|
||||
- ls
|
||||
- . /opt/esp/idf/export.sh
|
||||
- idf.py reconfigure
|
||||
- echo "BB-CI-$((1 + RANDOM % 999))" > bbid
|
||||
- sed -i -e s/BARBACK_ID=\"Barback\"/BARBACK_ID=\"`cat bbid`\"/ sdkconfig
|
||||
- idf.py reconfigure
|
||||
- idf.py build
|
|
@ -3,4 +3,5 @@
|
|||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
|
||||
project(barback)
|
||||
|
|
1
components/idf-dfplayermini
Submodule
1
components/idf-dfplayermini
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 7ec406c5af692b9c99ae9ed0c7fb5ba648a0a71e
|
|
@ -19,6 +19,6 @@ uint8_t pumps_get_duration(uint8_t idx);
|
|||
uint8_t pumps_set_enabled(uint8_t idx, uint8_t value);
|
||||
uint8_t pumps_get_enabled(uint8_t idx);
|
||||
|
||||
uint8_t pumps_get_state(uint8_t idx);
|
||||
uint8_t pumps_get_running(uint8_t idx);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -6,5 +6,6 @@ set(COMPONENT_SRCS "\
|
|||
user_button.c\
|
||||
")
|
||||
set(COMPONENT_ADD_INCLUDEDIRS ". ../include")
|
||||
set(REQUIRES idf-dfplayermini)
|
||||
|
||||
register_component()
|
||||
|
|
|
@ -68,7 +68,7 @@ static barback_ble_access_t barback_ble_pump_access_enabled = {
|
|||
}
|
||||
|
||||
static barback_ble_access_t barback_ble_pump_access_state = {
|
||||
.read = pumps_get_state,
|
||||
.read = pumps_get_running,
|
||||
};
|
||||
|
||||
#define BLE_CHAR_PUMP_STATE(idx) {\
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "ble.h"
|
||||
#include "user_button.h"
|
||||
#include "pumps.h"
|
||||
#include "dfplayermini.h"
|
||||
|
||||
static const char *TAG = "BARBACK";
|
||||
|
||||
|
@ -42,6 +43,10 @@ void app_main(void) {
|
|||
char *name = malloc(strlen(TAG) + 4);
|
||||
sprintf(name, "%s-%02X", TAG, mac[5]);
|
||||
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
|
||||
dfplayermini_init();
|
||||
|
||||
user_button_init();
|
||||
pumps_init();
|
||||
ble_init(name);
|
||||
|
|
14
main/pumps.c
14
main/pumps.c
|
@ -15,7 +15,7 @@ uint8_t running = 0;
|
|||
TimerHandle_t pump_timers[PUMPS];
|
||||
static uint8_t pumps_duration[PUMPS] = {0};
|
||||
static uint8_t pumps_enabled[PUMPS] = {0};
|
||||
static uint8_t pumps_state[PUMPS] = {0};
|
||||
static uint8_t pumps_running[PUMPS] = {0};
|
||||
static uint8_t safety = 1;
|
||||
|
||||
void pumps_update_config() {
|
||||
|
@ -38,6 +38,10 @@ uint8_t pumps_set_duration(uint8_t idx, uint8_t time) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
uint8_t pumps_get_duration(uint8_t idx) {
|
||||
return pumps_duration[idx];
|
||||
}
|
||||
|
||||
uint8_t pumps_set_enabled(uint8_t idx, uint8_t value) {
|
||||
uint8_t io = pump_gpio_map[idx];
|
||||
|
||||
|
@ -55,12 +59,8 @@ uint8_t pumps_get_enabled(uint8_t idx) {
|
|||
return pumps_enabled[idx] ? 1 : 0;
|
||||
}
|
||||
|
||||
uint8_t pumps_get_duration(uint8_t idx) {
|
||||
return pumps_duration[idx];
|
||||
}
|
||||
|
||||
uint8_t pumps_get_state(uint8_t idx) {
|
||||
return pumps_state[idx];
|
||||
uint8_t pumps_get_running(uint8_t idx) {
|
||||
return pumps_running[idx];
|
||||
}
|
||||
|
||||
uint8_t pump_enable(int8_t i) {
|
||||
|
|
Loading…
Reference in a new issue