Skip to content

Commit

Permalink
Merge pull request #2732 from hathach/fix-fsdev-issue
Browse files Browse the repository at this point in the history
fix fsdev issue introduced by #1942
  • Loading branch information
hathach authored Jul 22, 2024
2 parents e09cf36 + 4de46fc commit f09e23e
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 f09e23e

Please sign in to comment.