mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-10 23:15:08 +01:00
Merge pull request #43 from ramapcsx2/various
N64: Blink LED for EEP operations (they do take a while and the blink…
This commit is contained in:
commit
5eb6a69fec
@ -248,7 +248,7 @@ void draw_progressbar(uint32_t processedsize, uint32_t totalsize);
|
||||
//******************************************
|
||||
// Bitmaps
|
||||
//******************************************
|
||||
static const unsigned char PROGMEM icon [] = {
|
||||
static const uint8_t PROGMEM icon [] = {
|
||||
0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF,
|
||||
0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x0F, 0xFF, 0xF8, 0x00, 0x00, 0x0F, 0xFF,
|
||||
@ -287,7 +287,7 @@ static const unsigned char PROGMEM icon [] = {
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80
|
||||
};
|
||||
|
||||
static const unsigned char PROGMEM sig [] = {
|
||||
static const uint8_t PROGMEM sig [] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@ -986,7 +986,7 @@ int checkButton1() {
|
||||
}
|
||||
// Button released
|
||||
else if (buttonVal1 == HIGH && buttonLast1 == LOW && (millis() - downTime1) > debounce) {
|
||||
if (not ignoreUp1) {
|
||||
if (!ignoreUp1) {
|
||||
upTime1 = millis();
|
||||
if (DConUp1 == false) DCwaiting1 = true;
|
||||
else {
|
||||
@ -1005,7 +1005,7 @@ int checkButton1() {
|
||||
// Test for hold
|
||||
if (buttonVal1 == LOW && (millis() - downTime1) >= holdTime) {
|
||||
// Trigger "normal" hold
|
||||
if (not holdEventPast1) {
|
||||
if (!holdEventPast1) {
|
||||
event = 3;
|
||||
waitForUp1 = true;
|
||||
ignoreUp1 = true;
|
||||
@ -1016,7 +1016,7 @@ int checkButton1() {
|
||||
}
|
||||
// Trigger "long" hold
|
||||
if ((millis() - downTime1) >= longHoldTime) {
|
||||
if (not longholdEventPast1) {
|
||||
if (!longholdEventPast1) {
|
||||
event = 4;
|
||||
longholdEventPast1 = true;
|
||||
}
|
||||
@ -1046,7 +1046,7 @@ int checkButton2() {
|
||||
}
|
||||
// Button released
|
||||
else if (buttonVal2 == HIGH && buttonLast2 == LOW && (millis() - downTime2) > debounce) {
|
||||
if (not ignoreUp2) {
|
||||
if (!ignoreUp2) {
|
||||
upTime2 = millis();
|
||||
if (DConUp2 == false) DCwaiting2 = true;
|
||||
else {
|
||||
@ -1065,7 +1065,7 @@ int checkButton2() {
|
||||
// Test for hold
|
||||
if (buttonVal2 == LOW && (millis() - downTime2) >= holdTime) {
|
||||
// Trigger "normal" hold
|
||||
if (not holdEventPast2) {
|
||||
if (!holdEventPast2) {
|
||||
event = 3;
|
||||
waitForUp2 = true;
|
||||
ignoreUp2 = true;
|
||||
@ -1076,7 +1076,7 @@ int checkButton2() {
|
||||
}
|
||||
// Trigger "long" hold
|
||||
if ((millis() - downTime2) >= longHoldTime) {
|
||||
if (not longholdEventPast2) {
|
||||
if (!longholdEventPast2) {
|
||||
event = 4;
|
||||
longholdEventPast2 = true;
|
||||
}
|
||||
|
@ -1422,6 +1422,9 @@ void writeEeprom() {
|
||||
noInterrupts();
|
||||
|
||||
for (byte pageNumber = 0; pageNumber < 64; pageNumber++) {
|
||||
// Blink led
|
||||
PORTB ^= (1 << 4);
|
||||
|
||||
// Wait ~50ms between page writes or eeprom will have write errors
|
||||
pulseClock_N64(26000);
|
||||
|
||||
@ -1442,6 +1445,7 @@ void writeEeprom() {
|
||||
myFile.close();
|
||||
println_Msg(F("Done"));
|
||||
display_Update();
|
||||
delay(600);
|
||||
}
|
||||
else {
|
||||
print_Error(F("SD Error"), true);
|
||||
@ -1483,6 +1487,9 @@ void readEeprom() {
|
||||
noInterrupts();
|
||||
|
||||
for (byte pageNumber = 0; pageNumber < 64; pageNumber++) {
|
||||
// Blink led
|
||||
PORTB ^= (1 << 4);
|
||||
|
||||
// Send read command
|
||||
sendData(0x04);
|
||||
// Send Page number
|
||||
@ -1528,6 +1535,7 @@ unsigned long verifyEeprom() {
|
||||
// Wait 50ms or eeprom might lock up
|
||||
pulseClock_N64(26000);
|
||||
|
||||
display_Clear();
|
||||
print_Msg(F("Verifying against "));
|
||||
println_Msg(filePath);
|
||||
display_Update();
|
||||
@ -1540,6 +1548,9 @@ unsigned long verifyEeprom() {
|
||||
noInterrupts();
|
||||
|
||||
for (byte pageNumber = 0; pageNumber < 64; pageNumber++) {
|
||||
// Blink led
|
||||
PORTB ^= (1 << 4);
|
||||
|
||||
// Send read command
|
||||
sendData(0x04);
|
||||
// Send Page number
|
||||
|
Loading…
Reference in New Issue
Block a user