osMotorStop osMotorStop (macro)

osMotorStart, osMotorStop

Starts/Stops the Rumble Pak

Syntax

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

Description

osMotorStart is a function operates the Rumble Pak. It takes 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.

The osMotorStart function starts the Rumble Pak motor. Its argument is the OSPfs structure pointed to by pfs. Internally, it simple 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, of Chapter 26, SI Devices, in the programming manual.)

Return value is an error code. If the function terminates normally, a value of 0 is returned. The error code PFS_ERR_CONTRFAIL is returned, communication has failed, and the motor cannot 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 by pfs. By calling this function, the motor will stop. Internally, it only sends the command data for stopping the motor.

See also

osContInit, osMotorInit

Revision History

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