Skip to content

Commit

Permalink
Fix Windows CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
gamelaster committed Jan 21, 2023
1 parent 5a6cd28 commit 5e09eca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: [push, pull_request]

jobs:
build-windows:
runs-on: windows-2019
runs-on: windows-2022
defaults:
run:
shell: cmd
Expand All @@ -22,7 +22,7 @@ jobs:
with:
name: blisp Windows x64 build
path: |
build/tools/blisp/blisp.exe
build/tools/blisp/Release/blisp.exe
if-no-files-found: error

build-macos:
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ target_sources(libblisp_obj PRIVATE
target_include_directories(libblisp_obj PRIVATE ${CMAKE_SOURCE_DIR}/vendor/libserialport)

if(WIN32)
target_link_libraries(libblisp_obj PRIVATE Setupapi.lib)
target_link_libraries(libblisp PRIVATE Setupapi.lib)
target_link_libraries(libblisp_static PRIVATE Setupapi.lib)
target_compile_definitions(libblisp_obj PRIVATE LIBSERIALPORT_MSBUILD)
target_sources(libblisp_obj PRIVATE
${CMAKE_SOURCE_DIR}/vendor/libserialport/windows.c)
Expand Down
8 changes: 8 additions & 0 deletions lib/blisp_easy.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ int32_t blisp_easy_load_segment_data(

uint32_t sent_data = 0;
uint32_t buffer_size = 0;
#ifdef _WIN32
uint8_t buffer[4092];
#else
uint8_t buffer[buffer_max_size];
#endif

blisp_easy_report_progress(progress_callback, 0, segment_size);

Expand Down Expand Up @@ -333,7 +337,11 @@ int32_t blisp_easy_flash_write(struct blisp_device* device,

uint32_t sent_data = 0;
uint32_t buffer_size = 0;
#ifdef _WIN32
uint8_t buffer[2052];
#else
uint8_t buffer[buffer_max_size];
#endif
blisp_easy_report_progress(progress_callback, 0, data_size);

while (sent_data < data_size) {
Expand Down

0 comments on commit 5e09eca

Please sign in to comment.