mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-04 02:22:15 +02:00
add warning to tc, cleanup
This commit is contained in:
parent
9c69fde167
commit
be6cd3955a
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file tc.h
|
||||
* @brief Temperature control (tc) service IPC wrapper.
|
||||
* @author yellows8
|
||||
* @author Behemoth
|
||||
* @copyright libnx Authors
|
||||
*/
|
||||
#pragma once
|
||||
@ -18,8 +18,9 @@ void tcExit(void);
|
||||
Service* tcGetServiceSession(void);
|
||||
|
||||
Result tcEnableFanControl(void);
|
||||
/// @warning Disabling your fan can damage your system.
|
||||
Result tcDisableFanControl(void);
|
||||
Result tcIsFanControlEnabled(bool *status);
|
||||
/// Only available on [5.0.0+]
|
||||
/// Only available on [5.0.0+].
|
||||
Result tcGetSkinTemperatureMilliC(s32 *skinTemp);
|
||||
|
||||
|
@ -33,12 +33,9 @@ Result tcDisableFanControl(void) {
|
||||
}
|
||||
|
||||
Result tcIsFanControlEnabled(bool *status) {
|
||||
struct {
|
||||
u8 status;
|
||||
} out;
|
||||
|
||||
Result rc = serviceDispatchOut(&g_tcSrv, 8, out);
|
||||
if (R_SUCCEEDED(rc)) *status = out.status;
|
||||
u8 tmp=0;
|
||||
Result rc = serviceDispatchOut(&g_tcSrv, 8, tmp);
|
||||
if (R_SUCCEEDED(rc)) *status = tmp & 1;
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -46,11 +43,5 @@ Result tcGetSkinTemperatureMilliC(s32 *skinTemp) {
|
||||
if (hosversionBefore(5,0,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
struct {
|
||||
s32 skinTemp;
|
||||
} out;
|
||||
|
||||
Result rc = serviceDispatchOut(&g_tcSrv, 9, out);
|
||||
if (R_SUCCEEDED(rc)) *skinTemp = out.skinTemp;
|
||||
return rc;
|
||||
return serviceDispatchOut(&g_tcSrv, 9, *skinTemp);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user