summaryrefslogtreecommitdiff
path: root/software/first/first.c
diff options
context:
space:
mode:
Diffstat (limited to 'software/first/first.c')
-rw-r--r--software/first/first.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/software/first/first.c b/software/first/first.c
new file mode 100644
index 0000000..ed6e91b
--- /dev/null
+++ b/software/first/first.c
@@ -0,0 +1,33 @@
+/* Copyright 2019 SiFive, Inc */
+/* SPDX-License-Identifier: Apache-2.0 */
+
+#include <stdio.h>
+#include "super_blink.h"
+
+int main() {
+ printf("Hello, cute waffle!\n");
+
+ int error = 0;
+ int ledNum = 0;
+ int colours[NUM_LEDS] = {
+ GREEN_LED,
+ RED_LED,
+ BLUE_LED,
+ };
+
+ setup_GPIO();
+
+ while (!error) {
+ set_LED(colours[ledNum], ON);
+ delay(DELAY);
+
+ error = set_LED(colours[ledNum], OFF);
+ delay(DELAY);
+
+ ledNum++;
+
+ if (ledNum >= NUM_LEDS) {
+ ledNum = 0;
+ }
+ }
+}