summaryrefslogtreecommitdiff
path: root/chip/host/gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/host/gpio.c')
-rw-r--r--chip/host/gpio.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/chip/host/gpio.c b/chip/host/gpio.c
index ace8cbd482..3c15205ad5 100644
--- a/chip/host/gpio.c
+++ b/chip/host/gpio.c
@@ -8,6 +8,7 @@
#include "console.h"
#include "common.h"
+#include "console.h"
#include "gpio.h"
#include "timer.h"
#include "util.h"
@@ -15,6 +16,15 @@
static int gpio_values[GPIO_COUNT];
static int gpio_interrupt_enabled[GPIO_COUNT];
+/* Create a dictionary of names for debug console print */
+#define GPIO_INT(name, pin, flags, signal) #name,
+#define GPIO(name, pin, flags) #name,
+const char * gpio_names[GPIO_COUNT] = {
+ #include "gpio.wrap"
+};
+#undef GPIO
+#undef GPIO_INT
+
test_mockable void gpio_pre_init(void)
{
/* Nothing */
@@ -47,6 +57,8 @@ test_mockable void gpio_set_level(enum gpio_signal signal, int value)
gpio_values[signal] = value;
+ ccprints("Setting GPIO_%s to %d", gpio_names[signal], value);
+
if (signal >= GPIO_IH_COUNT || !gpio_interrupt_enabled[signal])
return;