Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed Jan 25, 2025
1 parent 6b3a595 commit 9c05900
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 51 deletions.
48 changes: 1 addition & 47 deletions examples/device/board_test/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*
*/

#if 1
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Expand Down Expand Up @@ -52,7 +51,7 @@ int main(void) {

// Blink and print every interval ms
if (!(board_millis() - start_ms < interval_ms)) {
// board_uart_write(HELLO_STR, strlen(HELLO_STR));
board_uart_write(HELLO_STR, strlen(HELLO_STR));

start_ms = board_millis();

Expand All @@ -68,51 +67,6 @@ int main(void) {
}
}

#else
#include <stdio.h>
#include <zephyr/kernel.h>
#include <zephyr/drivers/gpio.h>

/* 1000 msec = 1 sec */
#define SLEEP_TIME_MS 200

/* The devicetree node identifier for the "led0" alias. */
#define LED0_NODE DT_ALIAS(led0)

/*
* A build error on this line means your board is unsupported.
* See the sample documentation for information on how to fix this.
*/
static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);

int main(void)
{
int ret;
bool led_state = true;

if (!gpio_is_ready_dt(&led)) {
return 0;
}

ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
if (ret < 0) {
return 0;
}

while (1) {
ret = gpio_pin_toggle_dt(&led);
if (ret < 0) {
return 0;
}

led_state = !led_state;
printf("LED state: %s\n", led_state ? "ON" : "OFF");
k_msleep(SLEEP_TIME_MS);
}
return 0;
}
#endif

#if TUSB_MCU_VENDOR_ESPRESSIF
void app_main(void) {
main();
Expand Down
4 changes: 4 additions & 0 deletions hw/bsp/lpc11/family.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
#include "bsp/board_api.h"
#include "board.h"

extern void USB_IRQHandler(void);
extern void SysTick_Handler(void);
void SystemInit(void);

//--------------------------------------------------------------------+
// Forward USB interrupt events to TinyUSB IRQ Handler
//--------------------------------------------------------------------+
Expand Down
5 changes: 4 additions & 1 deletion hw/bsp/lpc11/family.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ function(add_board_target BOARD_TARGET)
update_board(${BOARD_TARGET})

if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(${BOARD_TARGET} PUBLIC -nostdlib)
target_compile_options(${BOARD_TARGET} PUBLIC
-nostdlib
-Wno-error=incompatible-pointer-types
)
target_link_options(${BOARD_TARGET} PUBLIC
"LINKER:--script=${LD_FILE_GNU}"
--specs=nosys.specs --specs=nano.specs
Expand Down
5 changes: 5 additions & 0 deletions hw/bsp/lpc18/family.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
#include "bsp/board_api.h"
#include "board.h"

extern void USB0_IRQHandler(void);
extern void USB1_IRQHandler(void);
extern void SysTick_Handler(void);
void SystemInit(void);

//--------------------------------------------------------------------+
// USB Interrupt Handler
//--------------------------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion hw/bsp/lpc18/family.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CFLAGS += \
-DCFG_TUSB_MCU=OPT_MCU_LPC18XX

# mcu driver cause following warnings
CFLAGS += -Wno-error=unused-parameter -Wno-error=strict-prototypes -Wno-error=cast-qual
CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-qual

LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs

Expand Down
5 changes: 5 additions & 0 deletions hw/bsp/lpc43/family.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
const uint32_t OscRateIn = 12000000;
const uint32_t ExtRateIn = 0;

extern void USB0_IRQHandler(void);
extern void USB1_IRQHandler(void);
extern void SysTick_Handler(void);
void SystemInit(void);

/*------------------------------------------------------------------*/
/* BOARD API
*------------------------------------------------------------------*/
Expand Down
5 changes: 4 additions & 1 deletion hw/bsp/lpc43/family.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ function(add_board_target BOARD_TARGET)
update_board(${BOARD_TARGET})

if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(${BOARD_TARGET} PUBLIC -nostdlib)
target_compile_options(${BOARD_TARGET} PUBLIC
-nostdlib
-Wno-error=incompatible-pointer-types
)
target_link_options(${BOARD_TARGET} PUBLIC
"LINKER:--script=${LD_FILE_GNU}"
--specs=nosys.specs --specs=nano.specs
Expand Down
1 change: 0 additions & 1 deletion hw/bsp/lpc43/family.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ CFLAGS += \
# mcu driver cause following warnings
CFLAGS += \
-Wno-error=unused-parameter \
-Wno-error=strict-prototypes \
-Wno-error=cast-qual \
-Wno-error=incompatible-pointer-types \

Expand Down
1 change: 1 addition & 0 deletions hw/bsp/nrf/family.mk
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ SRC_C += \

INC += \
$(TOP)/$(BOARD_PATH) \
$(TOP)/$(FAMILY_PATH)/nrfx_config \
$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
$(TOP)/${NRFX_PATH} \
$(TOP)/${NRFX_PATH}/mdk \
Expand Down

0 comments on commit 9c05900

Please sign in to comment.