Compare commits

..

8 commits

Author SHA1 Message Date
Morgan 'ARR\!' Allen
674594d32e adding woodpecker CI
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/manual/woodpecker Pipeline was successful
2022-04-14 23:15:34 -07:00
Morgan 'ARR\!' Allen
548d4eeaa0 use https instead of git for submodule
All checks were successful
continuous-integration/drone/push Build is passing
2021-10-19 20:18:57 -07:00
Morgan 'ARR\!' Allen
fdd9166e8e hrmph
Some checks failed
continuous-integration/drone/push Build is failing
2021-10-14 23:18:07 -07:00
Morgan 'ARR\!' Allen
c82f162115 weres teh trust
Some checks failed
continuous-integration/drone/push Build is failing
2021-10-14 23:17:26 -07:00
Morgan 'ARR\!' Allen
5c5033898d update submodules before testing
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is failing
2021-10-14 23:10:30 -07:00
Morgan 'ARR\!' Allen
049de947fd include idf-dfplaymini component and add basic audio functionality
Some checks failed
continuous-integration/drone/push Build is failing
2021-10-14 22:24:39 -07:00
Morgan 'ARR\!' Allen
b56ad43a59 fix name change in pumps start > running 2021-10-08 16:21:44 -07:00
Morgan 'ARR\!' Allen
54d7eb9277 small rename/rearrange 2021-09-28 18:43:44 -07:00
10 changed files with 40 additions and 12 deletions

View file

@ -6,6 +6,9 @@ steps:
- name: build - name: build
image: espressif/idf:release-v4.1 image: espressif/idf:release-v4.1
commands: commands:
- mkdir ~/.ssh
- ssh-keyscan -t rsa git.oit.cloud >> ~/.ssh/known_hosts
- git submodule update --init
- if [ -f sdkconfig ]; then - if [ -f sdkconfig ]; then
- rm sdkconfig - rm sdkconfig
- fi - fi

6
.gitmodules vendored
View file

@ -1,3 +1,3 @@
[submodule "components/esp32-lora"] [submodule "components/idf-dfplayermini"]
path = components/esp32-lora path = components/idf-dfplayermini
url = https://gitlab.com/morganrallen/esp32-lora.git url = https://git.oit.cloud/morgan/idf-dfplayermini.git

17
.woodpecker.yml Normal file
View 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

View file

@ -3,4 +3,5 @@
cmake_minimum_required(VERSION 3.5) cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake) include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(barback) project(barback)

@ -0,0 +1 @@
Subproject commit 7ec406c5af692b9c99ae9ed0c7fb5ba648a0a71e

View file

@ -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_set_enabled(uint8_t idx, uint8_t value);
uint8_t pumps_get_enabled(uint8_t idx); 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 #endif

View file

@ -6,5 +6,6 @@ set(COMPONENT_SRCS "\
user_button.c\ user_button.c\
") ")
set(COMPONENT_ADD_INCLUDEDIRS ". ../include") set(COMPONENT_ADD_INCLUDEDIRS ". ../include")
set(REQUIRES idf-dfplayermini)
register_component() register_component()

View file

@ -68,7 +68,7 @@ static barback_ble_access_t barback_ble_pump_access_enabled = {
} }
static barback_ble_access_t barback_ble_pump_access_state = { static barback_ble_access_t barback_ble_pump_access_state = {
.read = pumps_get_state, .read = pumps_get_running,
}; };
#define BLE_CHAR_PUMP_STATE(idx) {\ #define BLE_CHAR_PUMP_STATE(idx) {\

View file

@ -14,6 +14,7 @@
#include "ble.h" #include "ble.h"
#include "user_button.h" #include "user_button.h"
#include "pumps.h" #include "pumps.h"
#include "dfplayermini.h"
static const char *TAG = "BARBACK"; static const char *TAG = "BARBACK";
@ -42,6 +43,10 @@ void app_main(void) {
char *name = malloc(strlen(TAG) + 4); char *name = malloc(strlen(TAG) + 4);
sprintf(name, "%s-%02X", TAG, mac[5]); sprintf(name, "%s-%02X", TAG, mac[5]);
vTaskDelay(1000 / portTICK_PERIOD_MS);
dfplayermini_init();
user_button_init(); user_button_init();
pumps_init(); pumps_init();
ble_init(name); ble_init(name);

View file

@ -15,7 +15,7 @@ uint8_t running = 0;
TimerHandle_t pump_timers[PUMPS]; TimerHandle_t pump_timers[PUMPS];
static uint8_t pumps_duration[PUMPS] = {0}; static uint8_t pumps_duration[PUMPS] = {0};
static uint8_t pumps_enabled[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; static uint8_t safety = 1;
void pumps_update_config() { void pumps_update_config() {
@ -38,6 +38,10 @@ uint8_t pumps_set_duration(uint8_t idx, uint8_t time) {
return 0; 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 pumps_set_enabled(uint8_t idx, uint8_t value) {
uint8_t io = pump_gpio_map[idx]; 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; return pumps_enabled[idx] ? 1 : 0;
} }
uint8_t pumps_get_duration(uint8_t idx) { uint8_t pumps_get_running(uint8_t idx) {
return pumps_duration[idx]; return pumps_running[idx];
}
uint8_t pumps_get_state(uint8_t idx) {
return pumps_state[idx];
} }
uint8_t pump_enable(int8_t i) { uint8_t pump_enable(int8_t i) {