Exemple #1
0
/**
 * @brief Decrement the programming counter
 * @param startvalue Initial value of programming counter
 */
void counter_decrement(uint16_t startvalue) {

    uint16_t counter = counter_read();

    if (counter == 0xffff) counter = startvalue;
    if (counter == 0) return;

    counter--;

    counter_write(counter);
}
/*
 * Callback that is called when data are ready on serial port.
 */
static void counter_callback(gpointer data __attribute__((unused)),
                             gint source __attribute__((unused)),
                             GdkInputCondition condition __attribute__((unused)))
{
	counter_read(counter);
}