fix a bug in fsdev introduced by #1942

This commit is contained in:
hathach 2024-07-22 16:01:39 +07:00
parent e09cf36104
commit 4de46fcf97
No known key found for this signature in database
GPG Key ID: 26FAB84F615C3C52
5 changed files with 7 additions and 4 deletions

View File

@ -10,7 +10,6 @@ set(LD_RAM_SIZE 20K)
function(update_board TARGET)
target_compile_definitions(${TARGET} PUBLIC
SYSCLK_FREQ_144MHz_HSE=144000000
CH32_FLASH_ENHANCE_READ_MODE=1
CFG_EXAMPLE_MSC_DUAL_READONLY
)
endfunction()

View File

@ -8,7 +8,6 @@ set(LD_RAM_SIZE 10K)
function(update_board TARGET)
target_compile_definitions(${TARGET} PUBLIC
SYSCLK_FREQ_144MHz_HSI=144000000
CH32_FLASH_ENHANCE_READ_MODE=1
CFG_EXAMPLE_MSC_DUAL_READONLY
)
endfunction()

View File

@ -8,7 +8,6 @@ set(LD_RAM_SIZE 20K)
function(update_board TARGET)
target_compile_definitions(${TARGET} PUBLIC
SYSCLK_FREQ_144MHz_HSE=144000000
CH32_FLASH_ENHANCE_READ_MODE=1
CFG_EXAMPLE_MSC_DUAL_READONLY
)
endfunction()

View File

@ -72,6 +72,12 @@ function(add_board_target BOARD_TARGET)
update_board(${BOARD_TARGET})
if (LD_FLASH_SIZE STREQUAL 224K)
target_compile_definitions(${BOARD_TARGET} PUBLIC
CH32_FLASH_ENHANCE_READ_MODE=1
)
endif()
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(${BOARD_TARGET} PUBLIC
-mcmodel=medany

View File

@ -1004,7 +1004,7 @@ static bool dcd_write_packet_memory(uint16_t dst, const void *__restrict src, ui
srcVal++;
}
if (wNBytes) {
if (wNBytes & 0x01) {
temp1 = (uint16_t) *srcVal;
*pdwVal = temp1;
}