Skip to content

Commit

Permalink
Implement a fix for issue DediProgSW#61
Browse files Browse the repository at this point in the history
Switch order of if-statements for differentiation of Winbond flash sizes.
For more details see issue comments in DediProgSW#61 by @ozpaulb.
  • Loading branch information
depate committed May 25, 2023
1 parent 79391b3 commit 4e788c7
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions project.c
Original file line number Diff line number Diff line change
Expand Up @@ -1502,25 +1502,24 @@ void SetProgReadCommand(int Index)
mcode_Read = BULK_FAST_READ;
mcode_Program = PP_32BYTE;
mcode_SegmentErase = 0xD8;
} else if (strstr(Chip_Info.Class, SUPPORT_WINBOND_W25Pxx) != NULL) {

} else if (strstr(Chip_Info.Class, SUPPORT_WINBOND_W25Pxx_Large) != NULL) {
mcode_RDSR = RDSR;
mcode_WRSR = WRSR;
mcode_ChipErase = CHIP_ERASE;
mcode_Program = PAGE_PROGRAM;
mcode_Read = BULK_FAST_READ;
mcode_Program = PP_4ADR_256BYTE;
mcode_Read = BULK_4BYTE_FAST_READ;
mcode_SegmentErase = SE;
mcode_ProgramCode_4Adr = 0x02;
mcode_ReadCode = 0x0B;
} else if (strstr(Chip_Info.Class, SUPPORT_WINBOND_W25Pxx_Large) != NULL) {
mcode_ReadCode = 0x0C;
} else if (strstr(Chip_Info.Class, SUPPORT_WINBOND_W25Pxx) != NULL) {
mcode_RDSR = RDSR;
mcode_WRSR = WRSR;
mcode_ChipErase = CHIP_ERASE;
mcode_Program = PP_4ADR_256BYTE;
mcode_Read = BULK_4BYTE_FAST_READ;
mcode_Program = PAGE_PROGRAM;
mcode_Read = BULK_FAST_READ;
mcode_SegmentErase = SE;
mcode_ProgramCode_4Adr = 0x02;
mcode_ReadCode = 0x0C;
mcode_ReadCode = 0x0B;
} else if (strstr(Chip_Info.Class, SUPPORT_ST_M25Pxx_Large) != NULL) {
mcode_RDSR = RDSR;
mcode_WRSR = WRSR;
Expand Down

0 comments on commit 4e788c7

Please sign in to comment.