From 4aef43991afa70c3cb314881fd4bf0f3e1f8b41b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Sat, 20 Jun 2020 18:47:17 +0200 Subject: hw/misc/led: Emit a trace event when LED intensity has changed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Track the LED intensity, and emit a trace event when it changes. Reviewed-by: Richard Henderson Reviewed-by: Luc Michel Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200912134041.946260-4-f4bug@amsat.org> --- hw/misc/led.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hw/misc/led.c') diff --git a/hw/misc/led.c b/hw/misc/led.c index c5fa09a613..5266d026d0 100644 --- a/hw/misc/led.c +++ b/hw/misc/led.c @@ -41,6 +41,10 @@ void led_set_intensity(LEDState *s, unsigned intensity_percent) intensity_percent = LED_INTENSITY_PERCENT_MAX; } trace_led_set_intensity(s->description, s->color, intensity_percent); + if (intensity_percent != s->intensity_percent) { + trace_led_change_intensity(s->description, s->color, + s->intensity_percent, intensity_percent); + } s->intensity_percent = intensity_percent; } -- cgit v1.2.3