Skip to content
Snippets Groups Projects
Commit 4a813895 authored by dwn1c21's avatar dwn1c21
Browse files

Remove hello_world_nanosoc

parent a94cbfe5
No related branches found
No related tags found
No related merge requests found
Pipeline #11542 passed
add_subdirectory(screen)
add_subdirectory(usb)
add_subdirectory(sdcard)
add_subdirectory(nanosoc)
add_subdirectory(nanosoc_serial)
add_subdirectory(nanosoc_adp)
\ No newline at end of file
if (TARGET tinyusb_device)
add_executable(hello_world_nanosoc
hello_world_nanosoc.c
)
# Create C header file with the name <pio program>.pio.h
pico_generate_pio_header(hello_world_nanosoc
${SOCLABS_PIO_PATH}/ft1248x1/ft1248x1_sm.pio
)
# pull in common dependencies
target_link_libraries(hello_world_nanosoc
pico_stdlib
hardware_pio)
# enable usb output, disable uart output
pico_enable_stdio_usb(hello_world_nanosoc 1)
pico_enable_stdio_uart(hello_world_nanosoc 0)
# create map/bin/hex/uf2 file etc.
pico_add_extra_outputs(hello_world_nanosoc)
# add url via pico_set_program_url
elseif(PICO_ON_DEVICE)
message(WARNING "not building hello_world_nanosoc because TinyUSB submodule is not initialized in the SDK")
endif()
#include <stdio.h>
#include "pico/stdlib.h"
#include "hardware/pio.h"
#include "hardware/clocks.h"
#include "ft1248x1_sm.pio.h"
int main(){
stdio_init_all();
sleep_ms(500);
PIO pio = pio0;
if(pio_sm_is_claimed(pio,0))
{
while(1){
printf("ERROR: SM 0 ALREADY CLAIMED\n");
sleep_ms(200);
}
}
else {
printf("Hello, world! From RP2040\n");
ft1248x1_sm_program_init(pio);
while(1){
while(pio_sm_is_rx_fifo_empty(pio,0)){
printf("PC = %d\n", pio_sm_get_pc(pio,0));
sleep_ms(500);
pio_sm_restart(pio,0);
}
uint32_t c = pio_sm_get(pio, 0);
printf("%d", c);
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment