mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-15 17:18:01 +00:00
b405a22cd1
* api-hal-gpio: rework gpio on ll * one_wire_slave: rework gpio initialization * interrupts: add attribute weak to hal exti interrupts handlers * api-hal-gpio: add exti interrupt handlers * input: rework with api-hal-gpio interrupts * one_wire_slave: rework with api-hal-gpio interrupts * api-hal-gpio: fix incorrect exti line config * api-hal-gpio: add doxygen documentation * api-hal-gpio: add enable / disable interrupts * api-hal-gpio: add get_rfid_level * core: remove api-gpio * applications: rework gpio with api-hal-gpio * lib: rework gpio with api-hal-gpio * rfal: disable exti interrupt when rfal is inactive * rfal: add interrupt gpio reinitialization * api-hal-gpio: hide setting speed and pull mode LL implementation * stm32wbxx_it: remove unused EXTI handlers * api-hal-gpio: guard set, enable, disable and remove interrupt * Drop F4 target * Accessor: update gpio api usage Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
35 lines
No EOL
838 B
C
35 lines
No EOL
838 B
C
#include <furi.h>
|
|
#include <api-hal.h>
|
|
#include <string.h>
|
|
|
|
int32_t application_uart_write(void* p) {
|
|
// Red led for showing progress
|
|
GpioPin led = {.pin = GPIO_PIN_8, .port = GPIOA};
|
|
// TODO open record
|
|
GpioPin* led_record = &led;
|
|
|
|
hal_gpio_init(led_record, GpioModeOutputOpenDrain, GpioPullNo, GpioSpeedLow);
|
|
|
|
// create buffer
|
|
const char test_string[] = "test\n";
|
|
printf(test_string);
|
|
|
|
// for example, create counter and show its value
|
|
uint8_t counter = 0;
|
|
|
|
while(1) {
|
|
// continously write it to UART
|
|
printf("counter: %d\n", counter);
|
|
counter++;
|
|
|
|
// flash at every send
|
|
hal_gpio_write(led_record, false);
|
|
delay(50);
|
|
hal_gpio_write(led_record, true);
|
|
|
|
// delay with overall perion of 1s
|
|
delay(950);
|
|
}
|
|
|
|
return 0;
|
|
} |