diff --git a/src/rexbacklight.c b/src/rexbacklight.c index 74f04ea..267ebef 100644 --- a/src/rexbacklight.c +++ b/src/rexbacklight.c @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ + +//Needed for usleep to work #define _DEFAULT_SOURCE #include @@ -32,7 +34,7 @@ static const char* backlight_dir = "/sys/class/backlight/"; static const char* backlight_file = "brightness"; static const char* max_backlight_file = "max_brightness"; -//Used to store a dynamic array of dynamic strings and size +//Used to store a dynamic array of dynamic strings and number of strings struct string_array{ char** list; int size; @@ -127,7 +129,7 @@ void fade_out(int iv, int fv, int ms_duration, int steps){ float value = iv; //current value to write to file int step_delta = ms_duration / steps; int step_inc = step_delta; - float brdelta = (float)(fv - iv) / steps; //amount brightness needs to change overall + float brdelta = (float)(fv - iv) / steps; //amount brightness needs to change per iteration while(ms_duration > tdelta){ //write