Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adapt spade to work w/ HAL (depends on #2450) #2451

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions firmware/spade/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ target_link_libraries(spade
include_directories(${SPADE_TARGET}/jerry/include)
include_directories(./)

pico_enable_stdio_usb(${PROJECT_NAME} 1)
pico_enable_stdio_uart(${PROJECT_NAME} 1)

file(READ version.json VERSION_JSON)

string(JSON VERSION GET ${VERSION_JSON} version)
Expand Down
16 changes: 8 additions & 8 deletions firmware/spade/src/pc/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ static void keyboard(struct mfb_window *window, mfb_key key, mfb_key_mod mod, bo
mfb_close(window);
}

if (key == KB_KEY_W) spade_call_press( 5); // map_move(map_get_first('p'), 0, -1);
if (key == KB_KEY_S) spade_call_press( 7); // map_move(map_get_first('p'), 0, 1);
if (key == KB_KEY_A) spade_call_press( 6); // map_move(map_get_first('p'), 1, 0);
if (key == KB_KEY_D) spade_call_press( 8); // map_move(map_get_first('p'), -1, 0);
if (key == KB_KEY_I) spade_call_press(12); // map_move(map_get_first('p'), 0, -1);
if (key == KB_KEY_K) spade_call_press(14); // map_move(map_get_first('p'), 0, 1);
if (key == KB_KEY_J) spade_call_press(13); // map_move(map_get_first('p'), 1, 0);
if (key == KB_KEY_L) spade_call_press(15); // map_move(map_get_first('p'), -1, 0);
if (key == KB_KEY_W) spade_call_press(0); // map_move(map_get_first('p'), 0, -1);
if (key == KB_KEY_S) spade_call_press(1); // map_move(map_get_first('p'), 0, 1);
if (key == KB_KEY_A) spade_call_press(2); // map_move(map_get_first('p'), 1, 0);
if (key == KB_KEY_D) spade_call_press(3); // map_move(map_get_first('p'), -1, 0);
if (key == KB_KEY_I) spade_call_press(4); // map_move(map_get_first('p'), 0, -1);
if (key == KB_KEY_K) spade_call_press(5); // map_move(map_get_first('p'), 0, 1);
if (key == KB_KEY_J) spade_call_press(6); // map_move(map_get_first('p'), 1, 0);
if (key == KB_KEY_L) spade_call_press(7); // map_move(map_get_first('p'), -1, 0);
}
#endif

Expand Down
42 changes: 25 additions & 17 deletions firmware/spade/src/rpi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
pico_sdk_init()
add_definitions(-DSPADE_EMBEDDED -DSPADE_AUDIO -DPICO_NO_BI_PROGRAM_BUILD_DATE)
set(DCMAKE_BUILD_TYPE Release)
add_definitions(-DSPADE_EMBEDDED -DSPADE_AUDIO)
set(DCMAKE_BUILD_TYPE Debug)
target_compile_definitions(spade PRIVATE
# compile time configuration of I2S
PICO_AUDIO_I2S_MONO_INPUT=1
USE_AUDIO_I2S=1
PICO_AUDIO_I2S_DATA_PIN=9
PICO_AUDIO_I2S_CLOCK_PIN_BASE=10
# PICO_DEFAULT_UART=0
# PICO_DEFAULT_UART_TX_PIN=28
# PICO_DEFAULT_UART_RX_PIN=29
# compile time configuration of I2S
PICO_AUDIO_I2S_MONO_INPUT=1
USE_AUDIO_I2S=1
PICO_AUDIO_I2S_DATA_PIN=9
PICO_AUDIO_I2S_CLOCK_PIN_BASE=10
# PICO_DEFAULT_UART=0
# PICO_DEFAULT_UART_TX_PIN=28
# PICO_DEFAULT_UART_RX_PIN=29
)

pico_enable_stdio_usb(${PROJECT_NAME} 1)
pico_enable_stdio_uart(${PROJECT_NAME} 1)

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../sprig_hal sprig_hal)

target_link_libraries(spade PRIVATE
pico_stdlib
pico_audio_i2s
pico_multicore
hardware_spi
hardware_timer
hardware_pwm
hardware_adc
pico_stdlib
pico_audio_i2s
pico_multicore
hardware_spi
hardware_timer
hardware_pwm
hardware_adc
sprig_hal
)

add_compile_definitions(PICO_HEAP_SIZE=16384)

pico_enable_stdio_usb(spade 1)
pico_enable_stdio_uart(spade 0)

Expand Down
65 changes: 0 additions & 65 deletions firmware/spade/src/rpi/audio.c

This file was deleted.

Loading
Loading