fix multithread logic in template app, update gpio HAL (#250)

* fix multithread logic
* more buffer for dallas id string
* update apps to use new logic
* delay_us small speedup
* add consant qualifier to gpio records and some core api
* fix some apps to use simpler method of getting gpio record
* fix ibutton app, stupid stack problem
This commit is contained in:
DrZlo13
2020-11-19 15:25:32 +03:00
committed by GitHub
parent ccd40497eb
commit a96f23af9b
24 changed files with 137 additions and 88 deletions

View File

@@ -2,7 +2,11 @@
#include "api-hal-resources.h"
// init GPIO
void hal_gpio_init(GpioPin* gpio, GpioMode mode, GpioPull pull, GpioSpeed speed) {
void hal_gpio_init(
const GpioPin* gpio,
const GpioMode mode,
const GpioPull pull,
const GpioSpeed speed) {
// TODO: Alternate Functions
GPIO_InitTypeDef GPIO_InitStruct = {0};
@@ -16,10 +20,9 @@ void hal_gpio_init(GpioPin* gpio, GpioMode mode, GpioPull pull, GpioSpeed speed)
bool hal_gpio_read_sd_detect(void) {
bool result = false;
// create pin
GpioPin sd_cs_pin = sd_cs_gpio;
// TODO open record
GpioPin* sd_cs_record = &sd_cs_pin;
const GpioPin* sd_cs_record = &sd_cs_gpio;
// configure pin as input
gpio_init_ex(sd_cs_record, GpioModeInput, GpioPullUp, GpioSpeedVeryHigh);