mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-27 23:14:14 +01:00
Make the retrode mode work after using the normal mode by accident
This commit is contained in:
parent
b0d8bf15ee
commit
6d0ddda980
@ -73,6 +73,11 @@ void setup_SMS() {
|
|||||||
DDRH |= (1 << 3);
|
DDRH |= (1 << 3);
|
||||||
|
|
||||||
if (retrode_mode) {
|
if (retrode_mode) {
|
||||||
|
// Revert changes from the other mode
|
||||||
|
PORTH &= ~((1 << 0) | (1 << 3) | (1 << 5));
|
||||||
|
PORTL &= ~(1 << 1);
|
||||||
|
DDRH &= ~((1 << 0) | (1 << 5));
|
||||||
|
DDRL &= ~((1 << 1));
|
||||||
// Set Control Pins to Output OE(PH6)
|
// Set Control Pins to Output OE(PH6)
|
||||||
DDRH |= (1 << 6);
|
DDRH |= (1 << 6);
|
||||||
// WR(PL5) and RD(PL6)
|
// WR(PL5) and RD(PL6)
|
||||||
@ -80,12 +85,12 @@ void setup_SMS() {
|
|||||||
|
|
||||||
// Setting OE(PH6) HIGH
|
// Setting OE(PH6) HIGH
|
||||||
PORTH |= (1 << 6);
|
PORTH |= (1 << 6);
|
||||||
//PORTH &= ~(1 << 6); // set OE LOW
|
|
||||||
// Setting WR(PL5) and RD(PL6) HIGH
|
// Setting WR(PL5) and RD(PL6) HIGH
|
||||||
PORTL |= (1 << 5) | (1 << 6);
|
PORTL |= (1 << 5) | (1 << 6);
|
||||||
// RD(PL6)
|
|
||||||
//PORTL &= ~(1 << 6); // set RE LOW
|
|
||||||
} else {
|
} else {
|
||||||
|
// Revert changes from the other mode
|
||||||
|
PORTL &= ~((1 << 5) | (1 << 6));
|
||||||
|
DDRL &= ~((1 << 5) | (1 << 6));
|
||||||
// Set Control Pins to Output RST(PH0) WR(PH5) OE(PH6)
|
// Set Control Pins to Output RST(PH0) WR(PH5) OE(PH6)
|
||||||
DDRH |= (1 << 0) | (1 << 5) | (1 << 6);
|
DDRH |= (1 << 0) | (1 << 5) | (1 << 6);
|
||||||
// CE(PL1)
|
// CE(PL1)
|
||||||
|
Loading…
Reference in New Issue
Block a user