osMotorStart osMotorStart (macro)

osMotorStart, osMotorStop

Starts/stops the Rumble Pak motor

Syntax

#include <ultra64.h>        /* os.h */
s32 osMotorStart(OSPfs *pfs);
s32 osMotorStop(OSPfs *pfs);

Description

osMotorStart is a function that operates the Rumble Pak. It takes the OSPfs structure pfs, which is used to control the Rumble Pak, as an argument. This pfs structure used should be one that has been initialized by osMotorInit. The motor is started by calling osMotorStart.

Internally, it simply sends data to the Rumble Pak. For increased processing speed, it does not perform processes such as Rumble Pak status checking. Consequently, when the Rumble Pak is removed and reinserted, the motor cannot be operated without again calling osMotorInit. Of course, osMotorStart also uses the serial interface (SI) and performs message waiting internally, which you should consider when calling it. (For more information, see Q3 of Rumble Pak Function Items to Note (Q&A format) in Section 4 Rumble Pak, Chapter 26, SI Devices, in the programming manual).

The return values are error codes. 0 is returned if the process terminates normally. If the error code PFS_ERR_CONTRFAIL is returned, communication has failed, and the motor could no be operated. Although the chance of a transmission error is small, this error code must be checked to confirm whether the motor is actually operating.

The osMotorStop function stops the motor. Its argument is the OSPfs structure pointed to by pfs. The motor is stopped from running by calling this function. Internally, it simply sends command data to stop the motor.

See Also

osContInit, osMotorInit

Revision History

1999/02/01 Completely revised
1999/04/30 Changed format