#include <modules.h>\r
#include <vm8086.h>\r
#include "common.h"\r
+#include <timers.h>\r
\r
// === CONSTANTS ===\r
#define FLAG_LFB 0x1\r
// --- Cursor Control ---\r
int giVesaCursorX = -1;\r
int giVesaCursorY = -1;\r
- int giVesaCursorTimer = -1; // Invalid timer\r
+#if BLINKING_CURSOR\r
+tTimer *gpVesaCursorTimer;\r
+#endif\r
int gbVesa_CursorVisible = 0;\r
// --- 2D Video Stream Handlers ---\r
tDrvUtil_Video_BufInfo gVesa_BufInfo;\r
\r
// VM8086_Deallocate( info );\r
\r
+ #if BLINKING_CURSOR\r
+ // Create blink timer\r
+ gpVesaCursorTimer = Time_AllocateTimer( Vesa_FlipCursor, NULL );\r
+ #endif\r
+\r
// Install Device\r
giVesaDriverId = DevFS_AddDevice( &gVesa_DriverStruct );\r
if(giVesaDriverId == -1) return MODULE_ERR_MISC;\r
- \r
+\r
return MODULE_ERR_OK;\r
}\r
\r
\r
Vesa_int_FillModeList();\r
\r
- Time_RemoveTimer(giVesaCursorTimer);\r
- giVesaCursorTimer = -1;\r
+ Time_RemoveTimer(gpVesaCursorTimer);\r
\r
Mutex_Acquire( &glVesa_Lock );\r
\r
{\r
DrvUtil_Video_RemoveCursor( &gVesa_BufInfo );\r
#if BLINKING_CURSOR\r
- if(giVesaCursorTimer != -1) {\r
- Time_RemoveTimer(giVesaCursorTimer);\r
- giVesaCursorTimer = -1;\r
+ if(gpVesaCursorTimer) {\r
+ Time_RemoveTimer(gpVesaCursorTimer);\r
}\r
#endif\r
}\r
giVesaCursorY*giVT_CharHeight\r
);\r
#if BLINKING_CURSOR\r
- giVesaCursorTimer = Time_CreateTimer(VESA_CURSOR_PERIOD, Vesa_FlipCursor, NULL);\r
+ Time_ScheduleTimer( gpVesaCursorTimer, VESA_CURSOR_PERIOD );\r
#endif\r
}\r
else\r
gbVesa_CursorVisible = !gbVesa_CursorVisible;\r
\r
#if BLINKING_CURSOR\r
- giVesaCursorTimer = Time_CreateTimer(VESA_CURSOR_PERIOD, Vesa_FlipCursor, Arg);\r
+ Time_ScheduleTimer( gpVesaCursorTimer, VESA_CURSOR_PERIOD );\r
#endif\r
}\r
\r