Alors :
- install/uninstall : pas de problèmes
- si j'installe preos, c'est lent, puis au moment de quitter : "crash intercept". Le prog hibview qui apelle la DLL a son in_use à 1 puisque je ne le vois pas dans l'arborescence de la TI et il revient apres un reset.
- compilation en mode kernel :
#error EXECUTE_IN_GHOST_SPACE does not work in kernel mode yet
- dooros, kerno et unios : pas de problème de ralentissement
Mon code :
volatile unsigned short h_cptSynchro;
//to save the previous INT_HANDLER
INT_HANDLER OldInt1 = NULL;
INT_HANDLER OldInt5 = NULL;
//the counter
DEFINE_INT_HANDLER (IntCpt) {
h_cptSynchro++;
// ExecuteHandler (OldInt1);
}
/*===============================================================================================
== Initialise the counter for the synchronisation
===============================================================================================*/
void h_initSynchro(void) {
h_cptSynchro=0;
OldInt1 = GetIntVec (AUTO_INT_1);
OldInt5 = GetIntVec (AUTO_INT_5);
SetIntVec (AUTO_INT_1, IntCpt);
SetIntVec (AUTO_INT_5, DUMMY_HANDLER);
}
/*===============================================================================================
== Stop the counter
===============================================================================================*/
void h_freeSynchro(void) {
SetIntVec (AUTO_INT_1, OldInt1);
SetIntVec (AUTO_INT_5, OldInt5);
}
void h_synchro(unsigned short time) {
while(h_cptSynchro<time)
h_saveEnergy();
h_cptSynchro=0;
}
void h_startSynchro(void) {
h_cptSynchro=0;
}
void h_waitSynchro(unsigned short time) {
h_cptSynchro=0;
while(h_cptSynchro<time)
h_saveEnergy();
}
/*===============================================================================================
== Do a pause
=================================================================================================
== time : the time to wait between to press of button
===============================================================================================*/
void h_pause(unsigned short time) {
h_waitSynchro(time);
while (!(K_ENTER || K_ESC))
h_saveEnergy();
h_startSynchro();
}
et apres, la fonction qui est la boucle principale :
h_Code h_read(short num_line, short * bookmark, unsigned char * name_var, h_File * hfile,
h_Config * hcfg) {
short key=0;
short i;
short no_obj;
unsigned short pos_txt;
unsigned short next_pos_txt;
h_initSynchro();
draw:
//draw in the screen
h_drawPage(LCD_MEM,hfile);
h_synchro(hcfg->speed_key);
//wait for a key
do {
key=0;
if (K_DOWN && h_goDown(hfile)) { // h_go down
if (K_DIAM) { //to the bottom
h_goLastPage(hfile);
h_synchro(hcfg->speed_key);
} else if (K_2ND) { //by page
h_goPageDown(hfile);
h_synchro(hcfg->speed_key);
} else { //by pixel
h_goPixelDown(hfile);
h_synchro(hcfg->speed_scroll);
continue;
}
} else if (K_UP && h_goUp(hfile)) { //scroll to the beginning
if (K_DIAM) { //to the top
h_goFirstPage(hfile);
h_synchro(hcfg->speed_key);
} else if (K_2ND) { //by page
h_goPageUp(hfile);
h_synchro(hcfg->speed_key);
} else { //by pixel
h_goPixelUp(hfile);
h_synchro(hcfg->speed_scroll);
continue;
}
} else if (K_CLEAR) { // turn the calculator off
off();
} else if (K_APPS) { //the bookmarks
*bookmark=h_bookmarkMenu(hfile,LCD_MEM,hcfg);
if (*bookmark>=0 && *bookmark<hfile->nb_bkmks)
goto move;
*bookmark=-1;
goto draw;
} else if (K_ESC) {
if (K_2ND)
key=KEY_ESC+KEY_2ND;
else
key=KEY_ESC;
} else if (K_PLUS && K_DIAM) { //to control the contrast
OSContrastUp();
h_synchro(hcfg->speed_key);
} else if (K_MOINS && K_DIAM) {
OSContrastDn();
h_synchro(hcfg->speed_key);
} else {
h_saveEnergy();
}
} while (key==0);
h_synchro(hcfg->speed_key);
// memcpy(hfile->vscreen,LCD_MEM,LCD_SIZE);
h_freeSynchro();
return key;
}