v2 changes (no more ce/pgm pins)
This commit is contained in:
parent
47a04300dd
commit
dd83387795
26
src/main.cpp
26
src/main.cpp
|
@ -6,13 +6,15 @@
|
|||
// PROGMEM
|
||||
|
||||
#define ROM_BUFFER_LEN (256*1024)
|
||||
DMAMEM char buffer[ROM_BUFFER_LEN];
|
||||
char buffer[ROM_BUFFER_LEN];
|
||||
|
||||
int32_t inPins[] = { 19,18,14,15,40,41,17,16,22,23,20,21,38,39,26,27,24,25,30,31,-1 };
|
||||
// v1 uses 30/31
|
||||
int32_t inPins[] = { 19,18,14,15,40,41,17,16,22,23,20,21,38,39,26,27,24,25,/*30,31,*/-1 };
|
||||
int32_t outPins[] = { 10,12,11,13,8,7,36,37,-1 };
|
||||
|
||||
int32_t cePin = 30;
|
||||
int32_t pgmPin = 31;
|
||||
// v1
|
||||
//int32_t cePin = 30;
|
||||
//int32_t pgmPin = 31;
|
||||
|
||||
void readFile()
|
||||
{
|
||||
|
@ -62,19 +64,15 @@ void loop()
|
|||
{
|
||||
uint32_t io6 = GPIO6_DR;
|
||||
uint32_t outb = 0;
|
||||
uint8_t ce = digitalReadFast(cePin);
|
||||
|
||||
if(!ce)
|
||||
{
|
||||
// read address pins
|
||||
uint32_t addr = (((io6 >> 16) & 0xFFFF) | ((io6 & 0x3000) << 4));
|
||||
// read address pins
|
||||
uint32_t addr = ((io6 >> 16) & 0xFFFF) | ((io6 & 0x3000) << 4);
|
||||
|
||||
// get byte at addr
|
||||
char b = buffer[addr];
|
||||
// get byte at addr
|
||||
char b = buffer[addr];
|
||||
|
||||
// set data pins
|
||||
outb = ((b & 0x0F) << 0) | ((b & 0xF0) << 12);
|
||||
}
|
||||
// set data pins
|
||||
outb = ((b & 0x0F) << 0) | ((b & 0xF0) << 12);
|
||||
|
||||
GPIO7_DR = outb;
|
||||
|
||||
|
|
Loading…
Reference in New Issue