Skip to content

Commit a5768f5

Browse files
committed
more board_api.h rename
1 parent cf91660 commit a5768f5

File tree

56 files changed

+80
-88
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+80
-88
lines changed

hw/bsp/board_api.h

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
* This file is part of the TinyUSB stack.
2525
*/
2626

27-
#ifndef _BSP_BOARD_H_
28-
#define _BSP_BOARD_H_
27+
#ifndef _BOARD_API_H_
28+
#define _BOARD_API_H_
2929

3030
#ifdef __cplusplus
31-
extern "C" {
31+
extern "C" {
3232
#endif
3333

3434
#include <stdint.h>
@@ -62,40 +62,36 @@ uint32_t board_button_read(void);
6262

6363
// Get characters from UART
6464
// Return number of read bytes
65-
int board_uart_read(uint8_t* buf, int len);
65+
int board_uart_read(uint8_t *buf, int len);
6666

6767
// Send characters to UART
6868
// Return number of sent bytes
69-
int board_uart_write(void const * buf, int len);
69+
int board_uart_write(void const *buf, int len);
7070

7171
#if CFG_TUSB_OS == OPT_OS_NONE
72-
// Get current milliseconds, must be implemented when no RTOS is used
73-
uint32_t board_millis(void);
72+
// Get current milliseconds, must be implemented when no RTOS is used
73+
uint32_t board_millis(void);
7474

7575
#elif CFG_TUSB_OS == OPT_OS_FREERTOS
76-
static inline uint32_t board_millis(void)
77-
{
78-
return ( ( ((uint64_t) xTaskGetTickCount()) * 1000) / configTICK_RATE_HZ );
79-
}
76+
static inline uint32_t board_millis(void) {
77+
return ( ( ((uint64_t) xTaskGetTickCount()) * 1000) / configTICK_RATE_HZ );
78+
}
8079

8180
#elif CFG_TUSB_OS == OPT_OS_MYNEWT
82-
static inline uint32_t board_millis(void)
83-
{
84-
return os_time_ticks_to_ms32( os_time_get() );
85-
}
81+
static inline uint32_t board_millis(void) {
82+
return os_time_ticks_to_ms32( os_time_get() );
83+
}
8684

8785
#elif CFG_TUSB_OS == OPT_OS_PICO
88-
#include "pico/time.h"
89-
static inline uint32_t board_millis(void)
90-
{
91-
return to_ms_since_boot(get_absolute_time());
92-
}
86+
#include "pico/time.h"
87+
static inline uint32_t board_millis(void) {
88+
return to_ms_since_boot(get_absolute_time());
89+
}
9390

9491
#elif CFG_TUSB_OS == OPT_OS_RTTHREAD
95-
static inline uint32_t board_millis(void)
96-
{
97-
return (((uint64_t)rt_tick_get()) * 1000 / RT_TICK_PER_SECOND);
98-
}
92+
static inline uint32_t board_millis(void) {
93+
return (((uint64_t)rt_tick_get()) * 1000 / RT_TICK_PER_SECOND);
94+
}
9995

10096
#else
10197
#error "board_millis() is not implemented for this OS"
@@ -104,22 +100,18 @@ int board_uart_write(void const * buf, int len);
104100
//--------------------------------------------------------------------+
105101
// Helper functions
106102
//--------------------------------------------------------------------+
107-
static inline void board_led_on(void)
108-
{
103+
static inline void board_led_on(void) {
109104
board_led_write(true);
110105
}
111106

112-
static inline void board_led_off(void)
113-
{
107+
static inline void board_led_off(void) {
114108
board_led_write(false);
115109
}
116110

117111
// TODO remove
118-
static inline void board_delay(uint32_t ms)
119-
{
112+
static inline void board_delay(uint32_t ms) {
120113
uint32_t start_ms = board_millis();
121-
while (board_millis() - start_ms < ms)
122-
{
114+
while ( board_millis() - start_ms < ms ) {
123115
#if CFG_TUD_ENABLED
124116
// take chance to run usb background
125117
tud_task();
@@ -131,7 +123,7 @@ static inline void board_delay(uint32_t ms)
131123
int board_getchar(void);
132124

133125
#ifdef __cplusplus
134-
}
126+
}
135127
#endif
136128

137129
#endif

hw/bsp/broadcom_32bit/family.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* This file is part of the TinyUSB stack.
2525
*/
2626

27-
#include "bsp/board.h"
27+
#include "bsp/board_api.h"
2828
#include "board.h"
2929

3030
#include "broadcom/cpu.h"

hw/bsp/broadcom_64bit/family.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* This file is part of the TinyUSB stack.
2525
*/
2626

27-
#include "bsp/board.h"
27+
#include "bsp/board_api.h"
2828
#include "board.h"
2929

3030
#include "broadcom/cpu.h"

hw/bsp/brtmm90x/family.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* This file is part of the TinyUSB stack.
2525
*/
2626

27-
#include "bsp/board.h"
27+
#include "bsp/board_api.h"
2828
#include "board.h"
2929

3030
#include <ft900.h>

hw/bsp/ch32v307/family.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "debug_uart.h"
2929
#include "ch32v30x.h"
3030

31-
#include "bsp/board.h"
31+
#include "bsp/board_api.h"
3232
#include "board.h"
3333

3434
//--------------------------------------------------------------------+

hw/bsp/da14695_dk_usb/da14695_dk_usb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* This file is part of the TinyUSB stack.
2525
*/
2626

27-
#include "bsp/board.h"
27+
#include "bsp/board_api.h"
2828
#include <hal/hal_gpio.h>
2929
#include <mcu/mcu.h>
3030

hw/bsp/da1469x_dk_pro/da1469x-dk-pro.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* This file is part of the TinyUSB stack.
2525
*/
2626

27-
#include "bsp/board.h"
27+
#include "bsp/board_api.h"
2828
#include <hal/hal_gpio.h>
2929
#include <mcu/mcu.h>
3030

hw/bsp/espressif/boards/family.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* This file is part of the TinyUSB stack.
2525
*/
2626

27-
#include "bsp/board.h"
27+
#include "bsp/board_api.h"
2828
#include "board.h"
2929

3030
#include "esp_rom_gpio.h"

hw/bsp/f1c100s/f1c100s.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <malloc.h>
2929
#include <irqflags.h>
3030
#include <f1c100s-irq.h>
31-
#include "bsp/board.h"
31+
#include "bsp/board_api.h"
3232
#include "board.h"
3333

3434
extern void sys_uart_putc(char c);

hw/bsp/imxrt/family.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* This file is part of the TinyUSB stack.
2525
*/
2626

27-
#include "bsp/board.h"
27+
#include "bsp/board_api.h"
2828
#include "board.h"
2929

3030
// Suppress warning caused by mcu driver

0 commit comments

Comments
 (0)