Port changes from galp3-c to darp5 and lemp9
This commit is contained in:
@@ -80,7 +80,7 @@ static enum Result cmd_spi(void) {
|
|||||||
uint8_t flags = smfi_cmd[2];
|
uint8_t flags = smfi_cmd[2];
|
||||||
|
|
||||||
#ifdef __SCRATCH__
|
#ifdef __SCRATCH__
|
||||||
int len = (int)smfi_cmd[3];
|
uint8_t len = smfi_cmd[3];
|
||||||
|
|
||||||
// Enable chip (internal)
|
// Enable chip (internal)
|
||||||
ECINDAR3 = 0x7F;
|
ECINDAR3 = 0x7F;
|
||||||
@@ -89,7 +89,7 @@ static enum Result cmd_spi(void) {
|
|||||||
ECINDAR0 = 0x00;
|
ECINDAR0 = 0x00;
|
||||||
|
|
||||||
// Read or write len bytes
|
// Read or write len bytes
|
||||||
int i;
|
uint8_t i;
|
||||||
for (i = 0; (i < len) && ((i + 4) < ARRAY_SIZE(smfi_cmd)); i++) {
|
for (i = 0; (i < len) && ((i + 4) < ARRAY_SIZE(smfi_cmd)); i++) {
|
||||||
if (flags & CMD_SPI_FLAG_READ) {
|
if (flags & CMD_SPI_FLAG_READ) {
|
||||||
smfi_cmd[i + 4] = ECINDDR;
|
smfi_cmd[i + 4] = ECINDDR;
|
||||||
@@ -99,7 +99,7 @@ static enum Result cmd_spi(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set actually read/written count
|
// Set actually read/written count
|
||||||
smfi_cmd[3] = (uint8_t)i;
|
smfi_cmd[3] = i;
|
||||||
|
|
||||||
if (flags & CMD_SPI_FLAG_DISABLE) {
|
if (flags & CMD_SPI_FLAG_DISABLE) {
|
||||||
// Disable chip
|
// Disable chip
|
||||||
|
@@ -80,7 +80,7 @@ static enum Result cmd_spi(void) {
|
|||||||
uint8_t flags = smfi_cmd[2];
|
uint8_t flags = smfi_cmd[2];
|
||||||
|
|
||||||
#ifdef __SCRATCH__
|
#ifdef __SCRATCH__
|
||||||
int len = (int)smfi_cmd[3];
|
uint8_t len = smfi_cmd[3];
|
||||||
|
|
||||||
// Enable chip (internal)
|
// Enable chip (internal)
|
||||||
ECINDAR3 = 0x7F;
|
ECINDAR3 = 0x7F;
|
||||||
@@ -89,7 +89,7 @@ static enum Result cmd_spi(void) {
|
|||||||
ECINDAR0 = 0x00;
|
ECINDAR0 = 0x00;
|
||||||
|
|
||||||
// Read or write len bytes
|
// Read or write len bytes
|
||||||
int i;
|
uint8_t i;
|
||||||
for (i = 0; (i < len) && ((i + 4) < ARRAY_SIZE(smfi_cmd)); i++) {
|
for (i = 0; (i < len) && ((i + 4) < ARRAY_SIZE(smfi_cmd)); i++) {
|
||||||
if (flags & CMD_SPI_FLAG_READ) {
|
if (flags & CMD_SPI_FLAG_READ) {
|
||||||
smfi_cmd[i + 4] = ECINDDR;
|
smfi_cmd[i + 4] = ECINDDR;
|
||||||
@@ -99,7 +99,7 @@ static enum Result cmd_spi(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set actually read/written count
|
// Set actually read/written count
|
||||||
smfi_cmd[3] = (uint8_t)i;
|
smfi_cmd[3] = i;
|
||||||
|
|
||||||
if (flags & CMD_SPI_FLAG_DISABLE) {
|
if (flags & CMD_SPI_FLAG_DISABLE) {
|
||||||
// Disable chip
|
// Disable chip
|
||||||
|
Reference in New Issue
Block a user