I am trying to create an error buffer which sets the amount of time in seconds in which it will delay an error message on my LCD. The second value can be between 1 sec and 99 secs.
code for setting the value works and is fine it lets me change the value:
if(param == MOD_MAIN_ERR_BUF_MODE)
once i get the err_buf_val, i do some math to save tha value in seconds:
if(min>= err_buf_val <=max)
err_seconds = (err_buf_val * 1000000);
the problem is that err_buf_val will be doubled the value entered on the keypad everyother time it runs through the code. for instance if i set the value to 5 seconds then it switches between 5 and 10 seconds everytime through the function. and the err_seconds value will change between 5000000 and 10000000.
if anyone understands than let me know what u think.
err_buf_val is declared as a uint16
err_seconds is declared as a uint32