|
@@ -37,8 +37,8 @@ uint8_t memGetByte(uint32_t address) {
|
37
|
37
|
// Address needs more than 16 bits, we have to set the PAGE bit in i2c address
|
38
|
38
|
memAddress |= 2;
|
39
|
39
|
}
|
40
|
|
- addA = memAddress & 0xFF00;
|
41
|
|
- addB = memAddress & 0xFF;
|
|
40
|
+ addA = address & 0xFF00;
|
|
41
|
+ addB = address & 0xFF;
|
42
|
42
|
|
43
|
43
|
if (i2c_start(memAddress | I2C_WRITE) == 0) { // Send start, write address to read
|
44
|
44
|
i2c_write(addA);
|
|
@@ -61,8 +61,8 @@ uint8_t *memGetBytes(uint32_t address, uint8_t length) {
|
61
|
61
|
// Address needs more than 16 bits, we have to set the PAGE bit in i2c address
|
62
|
62
|
memAddress |= 2;
|
63
|
63
|
}
|
64
|
|
- addA = memAddress & 0xFF00;
|
65
|
|
- addB = memAddress & 0xFF;
|
|
64
|
+ addA = address & 0xFF00;
|
|
65
|
+ addB = address & 0xFF;
|
66
|
66
|
ret = (uint8_t *)malloc(length); // Allocate memory for values read
|
67
|
67
|
if (ret == NULL) {
|
68
|
68
|
#ifdef DEBUG
|
|
@@ -92,8 +92,8 @@ void memWriteByte(uint32_t address, uint8_t data) {
|
92
|
92
|
// Address needs more than 16 bits, we have to set the PAGE bit in i2c address
|
93
|
93
|
memAddress |= 2;
|
94
|
94
|
}
|
95
|
|
- addA = memAddress & 0xFF00;
|
96
|
|
- addB = memAddress & 0xFF;
|
|
95
|
+ addA = address & 0xFF00;
|
|
96
|
+ addB = address & 0xFF;
|
97
|
97
|
if (i2c_start(memAddress | I2C_WRITE) == 0) {
|
98
|
98
|
i2c_write(addA);
|
99
|
99
|
i2c_write(addB); // Give address to memory
|
|
@@ -108,8 +108,8 @@ void memWriteBytes(uint32_t address, uint8_t *data, uint8_t length) {
|
108
|
108
|
// Address needs more than 16 bits, we have to set the PAGE bit in i2c address
|
109
|
109
|
memAddress |= 2;
|
110
|
110
|
}
|
111
|
|
- addA = memAddress & 0xFF00;
|
112
|
|
- addB = memAddress & 0xFF;
|
|
111
|
+ addA = address & 0xFF00;
|
|
112
|
+ addB = address & 0xFF;
|
113
|
113
|
if (i2c_start(memAddress | I2C_WRITE) == 0) {
|
114
|
114
|
i2c_write(addA);
|
115
|
115
|
i2c_write(addB); // Give address to memory
|