Skip to content

Commit

Permalink
fix a bug in fsdev introduced by #1942
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed Jul 22, 2024
1 parent e09cf36 commit 4de46fc
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion hw/bsp/ch32v20x/boards/ch32v203c_r0_1v0/board.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
1 change: 0 additions & 1 deletion hw/bsp/ch32v20x/boards/ch32v203g_r0_1v0/board.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
1 change: 0 additions & 1 deletion hw/bsp/ch32v20x/boards/nanoch32v203/board.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
6 changes: 6 additions & 0 deletions hw/bsp/ch32v20x/family.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4de46fc

Please sign in to comment.