add Auto/Forced mode control for MBP15.1 (2018)

This commit is contained in:
Jeff Le
2018-11-07 21:29:54 +07:00
parent de3988463a
commit a2e290859e
13 changed files with 332 additions and 224 deletions

View File

@ -542,7 +542,8 @@ NSUserDefaults *defaults;
if ([[MachineDefaults computerModel] rangeOfString:@"MacBookPro15"].location != NSNotFound) {
for (i=0;i<[[FavoritesController arrangedObjects][cIndex][PREF_FAN_ARRAY] count];i++) {
[smcWrapper setKey_external:[NSString stringWithFormat:@"F%dMd",i] value:@"01"];
bool is_auto = [[FanController arrangedObjects][i][PREF_FAN_AUTO] boolValue];
[smcWrapper setKey_external:[NSString stringWithFormat:@"F%dMd",i] value:is_auto ? @"00" : @"01"];
float f_val = [[FanController arrangedObjects][i][PREF_FAN_SELSPEED] floatValue];
uint8 *vals = (uint8*)&f_val;
//NSString str_val = ;