mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-25 07:10:43 -04:00
refactoring
This commit is contained in:
parent
e80e4e3bfd
commit
df8e79f9e6
2 changed files with 11 additions and 5 deletions
|
@ -33,7 +33,7 @@
|
|||
namespace portapack {
|
||||
namespace cpld {
|
||||
|
||||
uint32_t update_if_necessary(
|
||||
CpldUpdateStatus update_if_necessary(
|
||||
const Config config
|
||||
) {
|
||||
jtag::GPIOTarget target {
|
||||
|
@ -51,7 +51,7 @@ uint32_t update_if_necessary(
|
|||
|
||||
/* Run-Test/Idle */
|
||||
if( !cpld.idcode_ok() ) {
|
||||
return 1;
|
||||
return CpldUpdateStatus::Idcode_check_failed;
|
||||
}
|
||||
|
||||
cpld.sample();
|
||||
|
@ -62,7 +62,7 @@ uint32_t update_if_necessary(
|
|||
* in passive state.
|
||||
*/
|
||||
if( !cpld.silicon_id_ok() ) {
|
||||
return 2;
|
||||
return CpldUpdateStatus::Silicon_id_check_failed;
|
||||
}
|
||||
|
||||
/* Verify CPLD contents against current bitstream. */
|
||||
|
@ -86,7 +86,7 @@ uint32_t update_if_necessary(
|
|||
cpld.disable();
|
||||
}
|
||||
|
||||
return ok ? 0 : 3;
|
||||
return ok ? CpldUpdateStatus::Success : CpldUpdateStatus::Program_failed;
|
||||
}
|
||||
|
||||
} /* namespace cpld */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue