Created
August 18, 2023 18:02
-
-
Save brandonros/b4b952ee97049def55e073e0d8a2f75d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define CYBT_DEBUG 1 | |
#define CYW43_DEBUG 1 | |
#define CYW43_VDEBUG(...) uart_printf(__VA_ARGS__) | |
#define CYW43_VERBOSE_DEBUG 1 | |
#include "pico/stdlib.h" | |
#include "pico/printf.h" | |
#include "pico/cyw43_arch.h" | |
#include "hardware/uart.h" | |
#define BUFFER_SIZE 1024 | |
void uart_printf(const char *format, ...) { | |
char buffer[BUFFER_SIZE]; | |
va_list args; | |
va_start(args, format); | |
vsnprintf(buffer, sizeof(buffer), format, args); | |
va_end(args); | |
uart_puts(uart0, buffer); | |
} | |
int main() { | |
uart_init(uart0, 115200); | |
gpio_set_function(16, GPIO_FUNC_UART); | |
gpio_set_function(17, GPIO_FUNC_UART); | |
int arch_init_ret_val = cyw43_arch_init(); | |
uart_printf("arch_init_ret_val = %d\n", arch_init_ret_val); | |
async_context_t* context = cyw43_arch_async_context(); | |
uart_printf("context = %p\n", context); | |
int hci_init_ret_val = cyw43_bluetooth_hci_init(); | |
uart_printf("cyw43_bluetooth_hci_init hci_init_ret_val = %d\n", hci_init_ret_val); | |
for (;;) { | |
//uart_printf("Hello, UART!\n"); | |
sleep_ms(1000); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Logs: