sysclk: code cleanup and fan speed
also fix incompatibility with nx fancontrol
This commit is contained in:
35
Source/sys-clk/common/src/pwm.c
Normal file
35
Source/sys-clk/common/src/pwm.c
Normal file
@@ -0,0 +1,35 @@
|
||||
#define NX_SERVICE_ASSUME_NON_DOMAIN
|
||||
#include <switch.h>
|
||||
#include "service_guard.h"
|
||||
#include "pwm.h"
|
||||
|
||||
static Service g_pwmSrv;
|
||||
|
||||
NX_GENERATE_SERVICE_GUARD(pwm);
|
||||
|
||||
Result _pwmInitialize(void) {
|
||||
return smGetService(&g_pwmSrv, "pwm");
|
||||
}
|
||||
|
||||
void _pwmCleanup(void) {
|
||||
serviceClose(&g_pwmSrv);
|
||||
}
|
||||
|
||||
Service* pwmGetServiceSession(void) {
|
||||
return &g_pwmSrv;
|
||||
}
|
||||
|
||||
Result pwmOpenSession2(PwmChannelSession *out, u32 device_code) {
|
||||
return serviceDispatchIn(&g_pwmSrv, 2, device_code,
|
||||
.out_num_objects = 1,
|
||||
.out_objects = &out->s,
|
||||
);
|
||||
}
|
||||
|
||||
Result pwmChannelSessionGetDutyCycle(PwmChannelSession *c, double* out) {
|
||||
return serviceDispatchOut(&c->s, 7, *out);
|
||||
}
|
||||
|
||||
void pwmChannelSessionClose(PwmChannelSession *controller) {
|
||||
serviceClose(&controller->s);
|
||||
}
|
||||
Reference in New Issue
Block a user