Api hw gpio pwm (#199)
* initial gpio layer * move temlplate.c to template.c.example in preparing to applications.mk rework * separate arduino layer * separate flipper_hal.x * prepare to switch applications on v2 core gpio api * swithch applications to v2 gpio api * gpio api for local target * better gpio_disable handling * remove pwm functions from local target * inline gpio funcs * common function to init all api's * fix local example blink * move delay us to hal api folder * move pwm_set/pwm_stop to hal api folder * update applications to use hal pwm api * remove gpio mode case warning * add speaker demo to build Co-authored-by: DrZlo13 <who.just.the.doctor@gmail.com>
This commit is contained in:
@@ -232,7 +232,11 @@ extern "C" void cc1101_workaround(void* p) {
|
||||
gui->add_widget(gui, widget, WidgetLayerFullscreen);
|
||||
|
||||
printf("[cc1101] creating device\n");
|
||||
CC1101 cc1101(GpioPin{CC1101_CS_GPIO_Port, CC1101_CS_Pin});
|
||||
GpioPin cs_pin = {CC1101_CS_GPIO_Port, CC1101_CS_Pin};
|
||||
|
||||
// TODO open record
|
||||
GpioPin* cs_pin_record = &cs_pin;
|
||||
CC1101 cc1101(cs_pin_record);
|
||||
printf("[cc1101] init device\n");
|
||||
|
||||
uint8_t address = cc1101.Init();
|
||||
@@ -254,9 +258,11 @@ extern "C" void cc1101_workaround(void* p) {
|
||||
|
||||
// create pin
|
||||
GpioPin led = {GPIOA, GPIO_PIN_8};
|
||||
// TODO open record
|
||||
GpioPin* led_record = &led;
|
||||
|
||||
// configure pin
|
||||
pinMode(led, GpioModeOpenDrain);
|
||||
pinMode(led_record, GpioModeOutputOpenDrain);
|
||||
|
||||
const int16_t RSSI_THRESHOLD = -89;
|
||||
|
||||
@@ -322,7 +328,8 @@ extern "C" void cc1101_workaround(void* p) {
|
||||
}
|
||||
|
||||
digitalWrite(
|
||||
led, (state->last_rssi > RSSI_THRESHOLD && !state->need_cc1101_conf) ? LOW : HIGH);
|
||||
led_record,
|
||||
(state->last_rssi > RSSI_THRESHOLD && !state->need_cc1101_conf) ? LOW : HIGH);
|
||||
|
||||
release_mutex(&state_mutex, state);
|
||||
widget_update(widget);
|
||||
|
Reference in New Issue
Block a user