bugfix: Pico W build.
This commit is contained in:
@@ -102,6 +102,15 @@ jobs:
|
|||||||
-DENABLE_BATT_LED=OFF
|
-DENABLE_BATT_LED=OFF
|
||||||
cmake --build build/no-batt-led --target ds5-bridge
|
cmake --build build/no-batt-led --target ds5-bridge
|
||||||
|
|
||||||
|
- name: Build Pico W firmware
|
||||||
|
run: |
|
||||||
|
cmake -S . -B build/picow -G Ninja \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DPICO_SDK_PATH="$PICO_SDK_PATH" \
|
||||||
|
-DPICO_W_BUILD=ON
|
||||||
|
cmake --build build/picow --target ds5-bridge
|
||||||
|
cp build/picow/ds5-bridge.uf2 artifacts/ds5-bridge-picow.uf2
|
||||||
|
|
||||||
- name: Upload standard UF2 artifact
|
- name: Upload standard UF2 artifact
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
@@ -115,3 +124,10 @@ jobs:
|
|||||||
path: artifacts/ds5-bridge-debug.uf2
|
path: artifacts/ds5-bridge-debug.uf2
|
||||||
archive: false
|
archive: false
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
|
- name: Upload PicoW UF2 artifact
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
path: artifacts/ds5-bridge-picow.uf2
|
||||||
|
archive: false
|
||||||
|
if-no-files-found: error
|
||||||
|
|||||||
@@ -59,12 +59,10 @@ else ()
|
|||||||
endif ()
|
endif ()
|
||||||
option(PICO_W_BUILD "Build for Rasberry Pi Pico W, audio is missing" OFF)
|
option(PICO_W_BUILD "Build for Rasberry Pi Pico W, audio is missing" OFF)
|
||||||
if (PICO_W_BUILD)
|
if (PICO_W_BUILD)
|
||||||
set(PICO_W_BUILD_VALUE 1)
|
|
||||||
set(CYW43_PIO_CLOCK_DIV_VALUE 3)
|
set(CYW43_PIO_CLOCK_DIV_VALUE 3)
|
||||||
set(SYS_CLOCK_KHZ_VALUE 200000)
|
set(SYS_CLOCK_KHZ_VALUE 200000)
|
||||||
set(DISABLE_SPEAKER_PROC_VALUE 1)
|
set(DISABLE_SPEAKER_PROC_VALUE 1)
|
||||||
else ()
|
else ()
|
||||||
set(PICO_W_BUILD_VALUE 0)
|
|
||||||
set(CYW43_PIO_CLOCK_DIV_VALUE 5)
|
set(CYW43_PIO_CLOCK_DIV_VALUE 5)
|
||||||
set(SYS_CLOCK_KHZ_VALUE 320000)
|
set(SYS_CLOCK_KHZ_VALUE 320000)
|
||||||
endif ()
|
endif ()
|
||||||
@@ -123,7 +121,6 @@ target_compile_definitions(ds5-bridge PRIVATE
|
|||||||
PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE=0
|
PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE=0
|
||||||
ENABLE_VERBOSE=${ENABLE_VERBOSE_VALUE}
|
ENABLE_VERBOSE=${ENABLE_VERBOSE_VALUE}
|
||||||
ENABLE_BATT_LED=${ENABLE_BATT_LED_VALUE}
|
ENABLE_BATT_LED=${ENABLE_BATT_LED_VALUE}
|
||||||
PICO_W_BUILD=${PICO_W_BUILD_VALUE}
|
|
||||||
SYS_CLOCK_KHZ=${SYS_CLOCK_KHZ_VALUE}
|
SYS_CLOCK_KHZ=${SYS_CLOCK_KHZ_VALUE}
|
||||||
DISABLE_SPEAKER_PROC=${DISABLE_SPEAKER_PROC_VALUE}
|
DISABLE_SPEAKER_PROC=${DISABLE_SPEAKER_PROC_VALUE}
|
||||||
)
|
)
|
||||||
|
|||||||
+2
-1
@@ -64,6 +64,7 @@ void audio_loop() {
|
|||||||
const float audio_gain = mute[0] ? 0.0f : powf(10.0f, get_config().speaker_volume / 20.0f);
|
const float audio_gain = mute[0] ? 0.0f : powf(10.0f, get_config().speaker_volume / 20.0f);
|
||||||
const float haptics_gain = get_config().haptics_gain;
|
const float haptics_gain = get_config().haptics_gain;
|
||||||
for (int i = 0; i < nframes; i++) {
|
for (int i = 0; i < nframes; i++) {
|
||||||
|
#if !DISABLE_SPEAKER_PROC
|
||||||
audio_buf[audio_buf_pos++] = raw[i * INPUT_CHANNELS] / 32768.0f * audio_gain;
|
audio_buf[audio_buf_pos++] = raw[i * INPUT_CHANNELS] / 32768.0f * audio_gain;
|
||||||
audio_buf[audio_buf_pos++] = raw[i * INPUT_CHANNELS + 1] / 32768.0f * audio_gain;
|
audio_buf[audio_buf_pos++] = raw[i * INPUT_CHANNELS + 1] / 32768.0f * audio_gain;
|
||||||
if (audio_buf_pos == 512 * 2) {
|
if (audio_buf_pos == 512 * 2) {
|
||||||
@@ -77,7 +78,7 @@ void audio_loop() {
|
|||||||
}
|
}
|
||||||
audio_buf_pos = 0;
|
audio_buf_pos = 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
in_buf[i * 2] = static_cast<WDL_ResampleSample>(clamp(raw[i * INPUT_CHANNELS + 2] / 32768.0f * haptics_gain,
|
in_buf[i * 2] = static_cast<WDL_ResampleSample>(clamp(raw[i * INPUT_CHANNELS + 2] / 32768.0f * haptics_gain,
|
||||||
-1.0f, 1.0f));
|
-1.0f, 1.0f));
|
||||||
in_buf[i * 2 + 1] = static_cast<WDL_ResampleSample>(clamp(raw[i * INPUT_CHANNELS + 3] / 32768.0f * haptics_gain,
|
in_buf[i * 2 + 1] = static_cast<WDL_ResampleSample>(clamp(raw[i * INPUT_CHANNELS + 3] / 32768.0f * haptics_gain,
|
||||||
|
|||||||
+1
-1
@@ -191,7 +191,7 @@ void tud_hid_set_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t rep
|
|||||||
int main() {
|
int main() {
|
||||||
vreg_set_voltage(VREG_VOLTAGE_1_20);
|
vreg_set_voltage(VREG_VOLTAGE_1_20);
|
||||||
sleep_ms(1000);
|
sleep_ms(1000);
|
||||||
set_sys_clock_khz(320000, true);
|
set_sys_clock_khz(SYS_CLOCK_KHZ, true);
|
||||||
|
|
||||||
board_init();
|
board_init();
|
||||||
tusb_rhport_init_t dev_init = {
|
tusb_rhport_init_t dev_init = {
|
||||||
|
|||||||
Reference in New Issue
Block a user