Compare commits
No commits in common. "674594d32e766ac428f1025aaaea640ef27a6107" and "e9eb537eee6fe6ad939e193e340568e0fc3443f7" have entirely different histories.
674594d32e
...
e9eb537eee
10 changed files with 12 additions and 40 deletions
|
@ -6,9 +6,6 @@ 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/idf-dfplayermini"]
|
||||
path = components/idf-dfplayermini
|
||||
url = https://git.oit.cloud/morgan/idf-dfplayermini.git
|
||||
[submodule "components/esp32-lora"]
|
||||
path = components/esp32-lora
|
||||
url = https://gitlab.com/morganrallen/esp32-lora.git
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
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,5 +3,4 @@
|
|||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
|
||||
project(barback)
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
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_running(uint8_t idx);
|
||||
uint8_t pumps_get_state(uint8_t idx);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -6,6 +6,5 @@ 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_running,
|
||||
.read = pumps_get_state,
|
||||
};
|
||||
|
||||
#define BLE_CHAR_PUMP_STATE(idx) {\
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "ble.h"
|
||||
#include "user_button.h"
|
||||
#include "pumps.h"
|
||||
#include "dfplayermini.h"
|
||||
|
||||
static const char *TAG = "BARBACK";
|
||||
|
||||
|
@ -43,10 +42,6 @@ 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_running[PUMPS] = {0};
|
||||
static uint8_t pumps_state[PUMPS] = {0};
|
||||
static uint8_t safety = 1;
|
||||
|
||||
void pumps_update_config() {
|
||||
|
@ -38,10 +38,6 @@ 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];
|
||||
|
||||
|
@ -59,8 +55,12 @@ uint8_t pumps_get_enabled(uint8_t idx) {
|
|||
return pumps_enabled[idx] ? 1 : 0;
|
||||
}
|
||||
|
||||
uint8_t pumps_get_running(uint8_t idx) {
|
||||
return pumps_running[idx];
|
||||
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 pump_enable(int8_t i) {
|
||||
|
|
Loading…
Reference in a new issue