Make blank timer read brightness path from data manager

After implementing the find_file class, the blank timer code
needed to be updated to pull the brightness path from the data
manager instead of using the build flag to ensure that we use the
proper path for brightness.

Change-Id: I084983ac0bd68b2fcdd69b93c2d18e2862ba0c77
This commit is contained in:
Ethan Yonker
2014-04-16 13:30:45 -05:00
parent eeed3c55d8
commit fc966505e5
2 changed files with 4 additions and 10 deletions
+4 -2
View File
@@ -117,7 +117,8 @@ int blanktimer::setClockTimer(void) {
int blanktimer::getBrightness(void) {
string results;
string brightness_path = EXPAND(TW_BRIGHTNESS_PATH);
string brightness_path;
DataManager::GetValue("tw_brightness_file", brightness_path);
if ((TWFunc::read_file(brightness_path, results)) != 0)
return -1;
int result = atoi(results.c_str());
@@ -135,9 +136,10 @@ int blanktimer::getBrightness(void) {
}
int blanktimer::setBrightness(int brightness) {
string brightness_path = EXPAND(TW_BRIGHTNESS_PATH);
string brightness_path;
string bstring;
char buff[100];
DataManager::GetValue("tw_brightness_file", brightness_path);
sprintf(buff, "%d", brightness);
bstring = buff;
if ((TWFunc::write_file(brightness_path, bstring)) != 0)