Enhance selftest mode

This patch adds a while loop to wait for the user to depress the encoder switch
before exiting selftest mode and continuing with the program.
Refactor enc_val to seconds

This variable will be used to specify the timer seconds. Also, using the
correct mask for printf.
Implement basic flag system

Flags are set according to interrupts to process events synchronously in the
main loop. This is to keep the ISR short and simple, and to limit the number
of global variables.

This patch implements a basic timer system, first the user selects the time and
on a button press the microcontroller activates both lamps and starts counting
down. When the timer ends, both lamps are shut down and the system can start
again.

Timer is set up using the timer1 peripheral, a 16 bit timer. Counting from a
fixed number up in order to create an interrupt every second. Drift is minimal
( approx 0.5s every 60 seconds) and could be improved in the future.