mirror of
https://github.com/pine64/blisp.git
synced 2025-01-03 04:10:31 +00:00
Windows fixes
This commit is contained in:
parent
17a6c2f4a1
commit
e3dea5b85d
@ -35,6 +35,8 @@ target_sources(libblisp_obj PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/vendor/libserialport/serialport.c
|
||||
${CMAKE_SOURCE_DIR}/vendor/libserialport/timing.c)
|
||||
|
||||
target_include_directories(libblisp_obj PRIVATE ${CMAKE_SOURCE_DIR}/vendor/libserialport)
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(libblisp_obj PRIVATE Setupapi.lib)
|
||||
target_compile_definitions(libblisp_obj PRIVATE LIBSERIALPORT_MSBUILD)
|
||||
@ -48,7 +50,6 @@ elseif(UNIX AND NOT APPLE)
|
||||
LIBSERIALPORT_ATBUILD
|
||||
"SP_API=__attribute__((visibility(\"default\")))"
|
||||
"SP_PRIV=__attribute__((visibility(\"hidden\")))")
|
||||
target_include_directories(libblisp_obj PRIVATE ${CMAKE_SOURCE_DIR}/vendor/libserialport)
|
||||
write_file(${CMAKE_SOURCE_DIR}/vendor/libserialport/config.h "// bypass errors.")
|
||||
elseif(APPLE)
|
||||
target_sources(libblisp_obj PRIVATE
|
||||
|
@ -84,7 +84,7 @@ int32_t blisp_send_command(struct blisp_device* device, uint8_t command, void* p
|
||||
uint32_t checksum = 0;
|
||||
checksum += device->tx_buffer[2] + device->tx_buffer[3];
|
||||
for (uint16_t i = 0; i < payload_size; i++) {
|
||||
checksum += *(uint8_t*)(payload + i);
|
||||
checksum += *(uint8_t*)((uint8_t*)payload + i);
|
||||
}
|
||||
device->tx_buffer[1] = checksum & 0xFF;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user