Browse Source

Create a bit in the request struct for Strength buzz requests so that process_requests is called at all

master
Konrad Anton 12 years ago
parent
commit
0473d9d2bb
  1. 4
      doc/Extending.txt
  2. 2
      ezchronos.c
  3. 5
      include/project.h
  4. 8
      logic/strength.c

4
doc/Extending.txt

@ -69,7 +69,9 @@ The [[file:../ezchronos.c::int main void][=main()=]] function begins by initiali
interrupt handler decides to wake up the system)
- Event processing: [[file:../ezchronos.c::fn%20wakeup_event][=wakeup_event=]] forwards button-press events
to the current modes.
- Measurement: [[file:../ezchronos.c::fn%20process_requests][=process_requests=]] for long-running measurements
- Measurement: [[file:../ezchronos.c::fn%20process_requests][=process_requests=]] for long-running measurements.
This function is only called if at least one flag in [[file:../ezchronos.c::volatile%20s_request_flags%20request][=request=]]
is set.
- Display Update: [[file:../ezchronos.c::fn%20display_update][=display_update=]] updates the display (see also
[[display_function][=display_function=]] and [[display_update][=display_update=]] callbacks)

2
ezchronos.c

@ -582,7 +582,7 @@ void process_requests(void)
if (request.flag.buzzer) start_buzzer(2, BUZZER_ON_TICKS, BUZZER_OFF_TICKS);
#ifdef CONFIG_STRENGTH
if(strength_data.num_beeps != 0)
if (request.flag.strength_buzzer && strength_data.num_beeps != 0)
{
start_buzzer(strength_data.num_beeps,
STRENGTH_BUZZER_ON_TICKS,

5
include/project.h

@ -117,7 +117,10 @@ typedef union
u16 voltage_measurement : 1; // 1 = Measure voltage
u16 altitude_measurement : 1; // 1 = Measure air pressure
u16 acceleration_measurement : 1; // 1 = Measure acceleration
u16 buzzer : 1; // 1 = Output buzzer
u16 buzzer : 1; // 1 = Output buzzer for alarm
#ifdef CONFIG_STRENGTH
u16 strength_buzzer : 1; // 1 = Output buzzer from strength_data
#endif
} flag;
u16 all_flags; // Shortcut to all display flags (for reset)
} s_request_flags;

8
logic/strength.c

@ -90,6 +90,14 @@ void strength_tick(void)
}
}
// strength_data.num_beeps describes the beeping pattern,
// but since beeping is done in the process_requests phase,
// we have to set a request flag so that process_requests
// is called at all.
if (strength_data.num_beeps != 0)
{
request.flag.strength_buzzer = 1;
}
}

Loading…
Cancel
Save