summaryrefslogtreecommitdiff
path: root/ports/risc-v64/gnu/example_build/erbium/board.c
diff options
context:
space:
mode:
authorFrédéric Desbiens <[email protected]>2026-10-02 10:42:44 -0400
committerGitHub <[email protected]>2026-10-02 10:42:44 -0400
commit93387b0a60382a29579bbad5045c68328e3751df (patch)
tree42be790d602cb76f55090e5a7c418df7ea2b3428 /ports/risc-v64/gnu/example_build/erbium/board.c
parent44d7c95c582d415c4ad84527180b29c93c3bf664 (diff)
parent28281cd5647d4671236ca08d19bd18ed15b2265a (diff)
Merge pull request #783 from eclipse-threadx/devv6.5.2.202603_rel
Merged changes ahead of the v6.5.2.202603 release
Diffstat (limited to 'ports/risc-v64/gnu/example_build/erbium/board.c')
-rw-r--r--ports/risc-v64/gnu/example_build/erbium/board.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/ports/risc-v64/gnu/example_build/erbium/board.c b/ports/risc-v64/gnu/example_build/erbium/board.c
new file mode 100644
index 00000000..b801b55d
--- /dev/null
+++ b/ports/risc-v64/gnu/example_build/erbium/board.c
@@ -0,0 +1,49 @@
+/***************************************************************************
+ * Copyright (c) 2026 Eclipse ThreadX contributors
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the MIT License which is available at
+ * https://opensource.org/licenses/MIT.
+ *
+ * AI Disclosure: This file was largely AI-generated by Claude Code (Opus 5.5).
+ * The AI-generated portions may be considered public domain (CC0-1.0)
+ * and not subject to the project's licence. The human contributor has
+ * reviewed and verified that the code is correct.
+ *
+ * SPDX-License-Identifier: MIT and CC0-1.0
+ **************************************************************************/
+
+#include "plic.h"
+#include "hwtimer.h"
+#include "uart.h"
+#include <stdint.h>
+#include <stddef.h>
+
+/* The example links without a C library; ThreadX needs memset. */
+void *memset(void *des, int c, size_t n)
+{
+ unsigned char *target = des;
+
+ for (size_t i = 0; i < n; i++)
+ target[i] = (unsigned char)c;
+ return des;
+}
+
+int board_init(void)
+{
+ int ret;
+
+ ret = plic_init();
+ if (ret)
+ return ret;
+
+ ret = uart_init();
+ if (ret)
+ return ret;
+
+ ret = hwtimer_init();
+ if (ret)
+ return ret;
+
+ return 0;
+}