mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-14 08:55:06 +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
|
// 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, 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,
|
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,
|
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
|
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,
|
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
|
// Button released
|
||||||
else if (buttonVal1 == HIGH && buttonLast1 == LOW && (millis() - downTime1) > debounce) {
|
else if (buttonVal1 == HIGH && buttonLast1 == LOW && (millis() - downTime1) > debounce) {
|
||||||
if (not ignoreUp1) {
|
if (!ignoreUp1) {
|
||||||
upTime1 = millis();
|
upTime1 = millis();
|
||||||
if (DConUp1 == false) DCwaiting1 = true;
|
if (DConUp1 == false) DCwaiting1 = true;
|
||||||
else {
|
else {
|
||||||
@ -1005,7 +1005,7 @@ int checkButton1() {
|
|||||||
// Test for hold
|
// Test for hold
|
||||||
if (buttonVal1 == LOW && (millis() - downTime1) >= holdTime) {
|
if (buttonVal1 == LOW && (millis() - downTime1) >= holdTime) {
|
||||||
// Trigger "normal" hold
|
// Trigger "normal" hold
|
||||||
if (not holdEventPast1) {
|
if (!holdEventPast1) {
|
||||||
event = 3;
|
event = 3;
|
||||||
waitForUp1 = true;
|
waitForUp1 = true;
|
||||||
ignoreUp1 = true;
|
ignoreUp1 = true;
|
||||||
@ -1016,7 +1016,7 @@ int checkButton1() {
|
|||||||
}
|
}
|
||||||
// Trigger "long" hold
|
// Trigger "long" hold
|
||||||
if ((millis() - downTime1) >= longHoldTime) {
|
if ((millis() - downTime1) >= longHoldTime) {
|
||||||
if (not longholdEventPast1) {
|
if (!longholdEventPast1) {
|
||||||
event = 4;
|
event = 4;
|
||||||
longholdEventPast1 = true;
|
longholdEventPast1 = true;
|
||||||
}
|
}
|
||||||
@ -1046,7 +1046,7 @@ int checkButton2() {
|
|||||||
}
|
}
|
||||||
// Button released
|
// Button released
|
||||||
else if (buttonVal2 == HIGH && buttonLast2 == LOW && (millis() - downTime2) > debounce) {
|
else if (buttonVal2 == HIGH && buttonLast2 == LOW && (millis() - downTime2) > debounce) {
|
||||||
if (not ignoreUp2) {
|
if (!ignoreUp2) {
|
||||||
upTime2 = millis();
|
upTime2 = millis();
|
||||||
if (DConUp2 == false) DCwaiting2 = true;
|
if (DConUp2 == false) DCwaiting2 = true;
|
||||||
else {
|
else {
|
||||||
@ -1065,7 +1065,7 @@ int checkButton2() {
|
|||||||
// Test for hold
|
// Test for hold
|
||||||
if (buttonVal2 == LOW && (millis() - downTime2) >= holdTime) {
|
if (buttonVal2 == LOW && (millis() - downTime2) >= holdTime) {
|
||||||
// Trigger "normal" hold
|
// Trigger "normal" hold
|
||||||
if (not holdEventPast2) {
|
if (!holdEventPast2) {
|
||||||
event = 3;
|
event = 3;
|
||||||
waitForUp2 = true;
|
waitForUp2 = true;
|
||||||
ignoreUp2 = true;
|
ignoreUp2 = true;
|
||||||
@ -1076,7 +1076,7 @@ int checkButton2() {
|
|||||||
}
|
}
|
||||||
// Trigger "long" hold
|
// Trigger "long" hold
|
||||||
if ((millis() - downTime2) >= longHoldTime) {
|
if ((millis() - downTime2) >= longHoldTime) {
|
||||||
if (not longholdEventPast2) {
|
if (!longholdEventPast2) {
|
||||||
event = 4;
|
event = 4;
|
||||||
longholdEventPast2 = true;
|
longholdEventPast2 = true;
|
||||||
}
|
}
|
||||||
|
@ -1422,6 +1422,9 @@ void writeEeprom() {
|
|||||||
noInterrupts();
|
noInterrupts();
|
||||||
|
|
||||||
for (byte pageNumber = 0; pageNumber < 64; pageNumber++) {
|
for (byte pageNumber = 0; pageNumber < 64; pageNumber++) {
|
||||||
|
// Blink led
|
||||||
|
PORTB ^= (1 << 4);
|
||||||
|
|
||||||
// Wait ~50ms between page writes or eeprom will have write errors
|
// Wait ~50ms between page writes or eeprom will have write errors
|
||||||
pulseClock_N64(26000);
|
pulseClock_N64(26000);
|
||||||
|
|
||||||
@ -1442,6 +1445,7 @@ void writeEeprom() {
|
|||||||
myFile.close();
|
myFile.close();
|
||||||
println_Msg(F("Done"));
|
println_Msg(F("Done"));
|
||||||
display_Update();
|
display_Update();
|
||||||
|
delay(600);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print_Error(F("SD Error"), true);
|
print_Error(F("SD Error"), true);
|
||||||
@ -1483,6 +1487,9 @@ void readEeprom() {
|
|||||||
noInterrupts();
|
noInterrupts();
|
||||||
|
|
||||||
for (byte pageNumber = 0; pageNumber < 64; pageNumber++) {
|
for (byte pageNumber = 0; pageNumber < 64; pageNumber++) {
|
||||||
|
// Blink led
|
||||||
|
PORTB ^= (1 << 4);
|
||||||
|
|
||||||
// Send read command
|
// Send read command
|
||||||
sendData(0x04);
|
sendData(0x04);
|
||||||
// Send Page number
|
// Send Page number
|
||||||
@ -1528,6 +1535,7 @@ unsigned long verifyEeprom() {
|
|||||||
// Wait 50ms or eeprom might lock up
|
// Wait 50ms or eeprom might lock up
|
||||||
pulseClock_N64(26000);
|
pulseClock_N64(26000);
|
||||||
|
|
||||||
|
display_Clear();
|
||||||
print_Msg(F("Verifying against "));
|
print_Msg(F("Verifying against "));
|
||||||
println_Msg(filePath);
|
println_Msg(filePath);
|
||||||
display_Update();
|
display_Update();
|
||||||
@ -1540,6 +1548,9 @@ unsigned long verifyEeprom() {
|
|||||||
noInterrupts();
|
noInterrupts();
|
||||||
|
|
||||||
for (byte pageNumber = 0; pageNumber < 64; pageNumber++) {
|
for (byte pageNumber = 0; pageNumber < 64; pageNumber++) {
|
||||||
|
// Blink led
|
||||||
|
PORTB ^= (1 << 4);
|
||||||
|
|
||||||
// Send read command
|
// Send read command
|
||||||
sendData(0x04);
|
sendData(0x04);
|
||||||
// Send Page number
|
// Send Page number
|
||||||
|
Loading…
Reference in New Issue
Block a user