Skip to content

Commit 6361f0d

Browse files
committed
STM_ShutdownToIdleEx appears
1 parent 29b8966 commit 6361f0d

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

‎gc/ogc/stm.h‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ distribution.
4747
extern "C" {
4848
#endif /* __cplusplus */
4949

50-
enum {
50+
// There are also in conf.h anyways
51+
enum STM_LedMode {
5152
STM_LEDMODE_OFF,
5253
STM_LEDMODE_DIM,
5354
STM_LEDMODE_BRIGHT,
@@ -58,6 +59,8 @@ enum {
5859

5960
STM_LEDFLASH_USER = (1 << 0),
6061
STM_LEDFLASH_NOEXEC = (1 << 1),
62+
63+
STM_IDLEMODE_FAN_ON = (1 << 0),
6164
};
6265

6366
typedef void (*stmcallback)(u32 event);
@@ -67,7 +70,8 @@ s32 __STM_Close(void);
6770
stmcallback STM_RegisterEventHandler(stmcallback newhandler);
6871

6972
s32 STM_ShutdownToStandby(void);
70-
s32 STM_ShutdownToIdle(void);
73+
s32 STM_ShutdownToIdleEx(u32 flags);
74+
#define STM_ShutdownToIdle() STM_ShutdownToIdleEx(0)
7175
s32 STM_RebootSystem(void);
7276

7377
s32 STM_SetLedMode(u32 mode);

‎libogc/stm.c‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,7 @@ s32 STM_ShutdownToStandby(void)
220220
return res;
221221
}
222222

223-
// idea: rename this to STM_ShutdownToIdleEx and give it some bitflags
224-
s32 STM_ShutdownToIdle(void)
223+
s32 STM_ShutdownToIdleEx(u32 flags)
225224
{
226225
int res;
227226
u32 config;
@@ -241,7 +240,12 @@ s32 STM_ShutdownToIdle(void)
241240
config = 0xFCE082C0;
242241
break;
243242
}
244-
res= __STM_SendCommand(IOCTL_STM_IDLE, &config, sizeof(u32), NULL, 0);
243+
244+
if (flags & STM_IDLEMODE_FAN_ON) {
245+
config &= ~(1 << 30);
246+
}
247+
248+
res = __STM_SendCommand(IOCTL_STM_IDLE, &config, sizeof(u32), NULL, 0);
245249
if(res<0) {
246250
STM_printf("STM IDLE failed: %d\n",res);
247251
}

0 commit comments

Comments
 (0)