Skip to content

Commit

Permalink
Check if the clock configuration is successfully applied before FPGA_ON
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavosr8 committed Jan 5, 2024
1 parent d7c579f commit 5acd98c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions port/board/afc-v4/payload.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,10 @@ void vTaskPayload( void *pvParameters )
*/

if (state == PAYLOAD_QUIESCED) {
QUIESCED_req = 0;
} else {
QUIESCED_req = 1;
}
QUIESCED_req = 0;
} else {
QUIESCED_req = 1;
}
xEventGroupClearBits( amc_payload_evt, PAYLOAD_MESSAGE_QUIESCE );
}

Expand Down Expand Up @@ -413,8 +413,10 @@ void vTaskPayload( void *pvParameters )
case PAYLOAD_STATE_FPGA_SETUP:
/* Configure the clock switch according to the configuration saved in EEPROM*/
eeprom_24xx02_read(CHIP_ID_RTC_EEPROM, 0x0, clock_config, 16, 10);
clock_switch_write_reg(clock_config);
new_state = PAYLOAD_FPGA_ON;
/* Only change the state if the clock config is efective*/
if( clock_switch_write_reg(clock_config) ){
new_state = PAYLOAD_FPGA_ON;
}
break;

case PAYLOAD_FPGA_ON:
Expand Down

0 comments on commit 5acd98c

Please sign in to comment.