From: Francois B <mrs...@us...> - 2005-04-30 19:14:51
|
Update of /cvsroot/openneo/openneo/apps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31336 Modified Files: background.h background.c Log Message: Now checks every seconds for changes in the settings and the fat table. Index: background.c =================================================================== RCS file: /cvsroot/openneo/openneo/apps/background.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** background.c 3 Apr 2005 20:28:30 -0000 1.1 --- background.c 30 Apr 2005 19:14:41 -0000 1.2 *************** *** 27,44 **** #include "ata.h" ! /* Half a stack should be enough */ ! static char background_stack[DEFAULT_STACK_SIZE/2]; static const char background_thread_name[] = "back"; static void background_thread(void) { while(1) { /* Save the fat info to the settings structure */ ! if( fat_get_fsinfo( &global_settings.last_fat_free_cluster_count, &global_settings.last_fat_next_free_cluster) ) ! settings_save(false); ! /* Write delayed sector if needed */ ! ata_flush_delayed(); sleep(HZ); --- 27,54 ---- #include "ata.h" ! static char background_stack[DEFAULT_STACK_SIZE]; static const char background_thread_name[] = "back"; + static bool suspend_fat_check = false; + + void background_suspend(bool suspend) + { + suspend_fat_check = suspend; + } static void background_thread(void) { + bool fat_changed; + while(1) { /* Save the fat info to the settings structure */ ! if( !suspend_fat_check ) ! fat_changed = fat_get_fsinfo( &global_settings.last_fat_free_cluster_count, &global_settings.last_fat_next_free_cluster); ! else ! fat_changed = false; ! /* Write the settings to the HD */ ! if( settings_dirty || fat_changed ) ! settings_save(true); sleep(HZ); Index: background.h =================================================================== RCS file: /cvsroot/openneo/openneo/apps/background.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** background.h 3 Apr 2005 20:28:30 -0000 1.1 --- background.h 30 Apr 2005 19:14:41 -0000 1.2 *************** *** 18,21 **** --- 18,22 ---- inline void background_init(void); + inline void background_suspend(bool suspend); #endif |