Skip to content

Commit

Permalink
set max vol when file is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris committed Sep 23, 2016
1 parent 287f5d0 commit 4cc6462
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kitsune/i2c_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,9 @@ volatile int sys_volume = 64;

#define VOL_LOC "/hello/vol"
int get_system_volume() {
return fs_get(VOL_LOC, &sys_volume, sizeof(sys_volume), NULL);
if( fs_get(VOL_LOC, &sys_volume, sizeof(sys_volume), NULL) < 0 ) {
sys_volume = 64;
}
}
int32_t set_system_volume(int new_volume) {
if( new_volume != sys_volume ) {
Expand Down

0 comments on commit 4cc6462

Please sign in to comment.