Changed EEPROM programmer timings
This commit is contained in:
parent
054f2dd0bd
commit
35a5eb6119
|
@ -91,7 +91,7 @@ void program_eeprom() {
|
||||||
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_4, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_4, GPIO_PIN_SET);
|
||||||
|
|
||||||
// Check if the data is written
|
// Check if the data is written
|
||||||
if (write_counter < 5) {
|
if (write_counter < 100) {
|
||||||
// Select correct device and address
|
// Select correct device and address
|
||||||
select_device(memory_map_0[0]);
|
select_device(memory_map_0[0]);
|
||||||
write_address(address_counter);
|
write_address(address_counter);
|
||||||
|
@ -121,9 +121,9 @@ void program_eeprom() {
|
||||||
send_rd(0);
|
send_rd(0);
|
||||||
|
|
||||||
printf("Progress: %i/%i\r", address_counter, control.eeprom.length);
|
printf("Progress: %i/%i\r", address_counter, control.eeprom.length);
|
||||||
} else if (read_counter > 2000) {
|
} else if (read_counter > 4000) {
|
||||||
// In case we failed, try again
|
// In case we failed, try again
|
||||||
printf("Trying again!\n\r");
|
printf("Trying again! %x != %x (%i)\n\r", d, control.eeprom.data[address_counter], address_counter);
|
||||||
read_counter = 0;
|
read_counter = 0;
|
||||||
write_counter = 0;
|
write_counter = 0;
|
||||||
send_rd(0);
|
send_rd(0);
|
||||||
|
@ -260,7 +260,9 @@ void handle_ioreq() {
|
||||||
|
|
||||||
void cycle() {
|
void cycle() {
|
||||||
// Make sure data get reset as input
|
// Make sure data get reset as input
|
||||||
|
if (!control.eeprom.programming) {
|
||||||
enable_data_out(0);
|
enable_data_out(0);
|
||||||
|
}
|
||||||
|
|
||||||
// We need this not detect IO multiple times
|
// We need this not detect IO multiple times
|
||||||
static uint8_t had_ioreq = 0;
|
static uint8_t had_ioreq = 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user