Skip to content

Commit

Permalink
Derp
Browse files Browse the repository at this point in the history
Fix 8KB/64KB EEPROM support
  • Loading branch information
TuxSH authored Jun 16, 2016
1 parent 40c4e3d commit 71290ff
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions source/SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ Result SPIWriteSaveData(CardType type, u32 offset, void* data, u32 size) {
break;
case EEPROM_8KB:
case EEPROM_64KB:
cmdSize = 3;
cmd[0] = SPI_EEPROM_CMD_WRITE;
cmd[1] = (u8)(pos >> 8);
cmd[2] = (u8) pos;
break;
case EEPROM_128KB:
cmdSize = 4;
cmd[0] = SPI_EEPROM_CMD_WRITE;
Expand Down Expand Up @@ -224,6 +229,10 @@ Result SPIReadSaveData(CardType type, u32 offset, void* data, u32 size) {
break;
case EEPROM_8KB:
case EEPROM_64KB:
cmdSize = 3;
cmd[1] = (u8)(pos >> 8);
cmd[2] = (u8) pos;
break;
case EEPROM_128KB:
cmdSize = 4;
cmd[1] = (u8)(pos >> 16);
Expand Down

0 comments on commit 71290ff

Please sign in to comment.