git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kernel - Slight reworks to timer code
[tpg/acess2.git]
/
Modules
/
Storage
/
FDDv2
/
fdc.c
diff --git
a/Modules/Storage/FDDv2/fdc.c
b/Modules/Storage/FDDv2/fdc.c
index
5f315aa
..
e86b31c
100644
(file)
--- a/
Modules/Storage/FDDv2/fdc.c
+++ b/
Modules/Storage/FDDv2/fdc.c
@@
-5,10
+5,11
@@
* fdc.c
* - FDC IO Functions
*/
* fdc.c
* - FDC IO Functions
*/
-#define DEBUG
1
+#define DEBUG
0
#include <acess.h>
#include "common.h"
#include <dma.h>
#include <acess.h>
#include "common.h"
#include <dma.h>
+#include <timers.h>
// === CONSTANTS ===
#define MOTOR_ON_DELAY 500
// === CONSTANTS ===
#define MOTOR_ON_DELAY 500
@@
-105,7
+106,7
@@
int FDD_int_ReadWriteTrack(int Disk, int Track, int bWrite, void *Buffer)
Uint16 base = FDD_int_GetBase(Disk, &_disk);
int cyl = Track >> 1, head = Track & 1;
Uint16 base = FDD_int_GetBase(Disk, &_disk);
int cyl = Track >> 1, head = Track & 1;
- ENTER("iDisk iTrack
B
bWrite pBuffer", Disk, Track, bWrite, Buffer);
+ ENTER("iDisk iTrack
i
bWrite pBuffer", Disk, Track, bWrite, Buffer);
Mutex_Acquire( &gFDD_IOMutex );
Mutex_Acquire( &gFDD_IOMutex );
@@
-400,7
+401,7
@@
int FDD_int_StartMotor(int Disk)
// Clear the motor off timer
Time_RemoveTimer(gaFDD_Disks[Disk].Timer);
// Clear the motor off timer
Time_RemoveTimer(gaFDD_Disks[Disk].Timer);
- gaFDD_Disks[Disk].Timer =
-1
;
+ gaFDD_Disks[Disk].Timer =
NULL
;
// Check if the motor is already on
if( gaFDD_Disks[Disk].MotorState == MOTOR_ATSPEED )
// Check if the motor is already on
if( gaFDD_Disks[Disk].MotorState == MOTOR_ATSPEED )
@@
-424,7
+425,7
@@
int FDD_int_StopMotor(int Disk)
{
if( gaFDD_Disks[Disk].MotorState != MOTOR_ATSPEED )
return 0;
{
if( gaFDD_Disks[Disk].MotorState != MOTOR_ATSPEED )
return 0;
- if( gaFDD_Disks[Disk].Timer !=
-1
)
+ if( gaFDD_Disks[Disk].Timer !=
NULL
)
return 0;
gaFDD_Disks[Disk].Timer = Time_CreateTimer(MOTOR_OFF_DELAY, FDD_int_StopMotorCallback, (void*)(tVAddr)Disk);
return 0;
gaFDD_Disks[Disk].Timer = Time_CreateTimer(MOTOR_OFF_DELAY, FDD_int_StopMotorCallback, (void*)(tVAddr)Disk);
@@
-442,7
+443,7
@@
void FDD_int_StopMotorCallback(void *Ptr)
int _disk;
Uint16 base = FDD_int_GetBase(Disk, &_disk);
int _disk;
Uint16 base = FDD_int_GetBase(Disk, &_disk);
- gaFDD_Disks[Disk].Timer =
-1
;
+ gaFDD_Disks[Disk].Timer =
NULL
;
gaFDD_Disks[Disk].MotorState = MOTOR_OFF;
outb(base + FDC_DOR, inb(base+FDC_DOR) & ~(1 << (_disk + 4)));
gaFDD_Disks[Disk].MotorState = MOTOR_OFF;
outb(base + FDC_DOR, inb(base+FDC_DOR) & ~(1 << (_disk + 4)));
UCC
git Repository :: git.ucc.asn.au