Skip to content

Commit

Permalink
Merge pull request #501 from PartialVolume/Change_HPA_message_to_stop…
Browse files Browse the repository at this point in the history
…_flashing_move_to_end_of_line

Change_HPA_message_to_stop_flashing_&_move_to_end_of_line
  • Loading branch information
PartialVolume authored Oct 17, 2023
2 parents ab9d269 + 725c79b commit 7d2517a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 40 deletions.
1 change: 1 addition & 0 deletions src/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ int check_device( nwipe_context_t*** c, PedDevice* dev, int dcount )
}

/* Initialise the variables that toggle the [size][temp c] with [HPA status]
* Not currently used, but may be used in the future or for other purposes
*/
next_device->HPA_toggle_time = time( NULL );
next_device->HPA_display_toggle_state = 0;
Expand Down
64 changes: 24 additions & 40 deletions src/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,51 +832,35 @@ void nwipe_gui_select( int count, nwipe_context_t** c )
/* print the temperature */
wprintw_temperature( c[i + offset] );

/* Toggle the drive/serial with [HDA/DCO Status]
*/
switch( c[i + offset]->HPA_display_toggle_state )
switch( c[i + offset]->HPA_status )
{
case 0:
/* print the drive model and serial number */
wprintw( main_window, " %s/%s", c[i + offset]->device_model, c[i + offset]->device_serial_no );
case HPA_ENABLED:
wprintw( main_window, " " );
wattron( main_window, COLOR_PAIR( 9 ) );
wprintw( main_window, "[HS? YES!]" );
wattroff( main_window, COLOR_PAIR( 9 ) );
break;

case 1:
switch( c[i + offset]->HPA_status )
{
case HPA_ENABLED:
wprintw( main_window, " " );
wattron( main_window, COLOR_PAIR( 9 ) );
wprintw( main_window, " HPA/DCO Hidden sectors detected !!" );
wattroff( main_window, COLOR_PAIR( 9 ) );
break;

case HPA_DISABLED:
wprintw( main_window, " " );
wprintw( main_window, "HPA/DCO No hidden sectors detected " );
break;

case HPA_UNKNOWN:
wprintw( main_window, " " );
wattron( main_window, COLOR_PAIR( 9 ) );
wprintw( main_window, " HPA/DCO hidden sectors indeterminate " );
wattroff( main_window, COLOR_PAIR( 9 ) );
break;

case HPA_NOT_APPLICABLE:
/* print the drive model and serial number */
wprintw( main_window,
" %s/%s",
c[i + offset]->device_model,
c[i + offset]->device_serial_no );
break;

default:

break;
}
case HPA_DISABLED:
wprintw( main_window, " " );
wprintw( main_window, "[HS? NO ]" );
break;

case HPA_UNKNOWN:
wprintw( main_window, " " );
wprintw( main_window, "[HS? ???]" );
break;

default:

wprintw( main_window, " " );
wprintw( main_window, "[HS? N/A]" );
break;
}

/* print the drive model and serial number */
wprintw( main_window, " %s/%s", c[i + offset]->device_model, c[i + offset]->device_serial_no );

if( c[i + offset]->HPA_toggle_time + 1 < time( NULL ) )
{
switch( c[i + offset]->HPA_display_toggle_state )
Expand Down

0 comments on commit 7d2517a

Please sign in to comment.