You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "acassis (via GitHub)" <gi...@apache.org> on 2023/02/02 21:26:15 UTC

[GitHub] [nuttx] acassis commented on a diff in pull request #8411: Hpmicro

acassis commented on code in PR #8411:
URL: https://github.com/apache/nuttx/pull/8411#discussion_r1095097920


##########
arch/risc-v/src/hpmicro/hpm6750/hpm_irq.c:
##########
@@ -0,0 +1,214 @@
+/****************************************************************************
+ * arch/risc-v/src/hpm6750/hpm6750_irq.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdint.h>
+#include <stdio.h>
+#include <assert.h>
+#include <debug.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/irq.h>
+
+#include "riscv_internal.h"
+#include "board.h"
+#include "hpm_interrupt.h"
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: up_irqinitialize
+ ****************************************************************************/
+
+void up_irqinitialize(void)
+{
+  int id;
+  uint32_t val;
+
+  /* Disable Machine interrupts */
+
+  up_irq_save();
+
+  /* Disable all global interrupts */
+
+  for (id = 1; id <= 127; id++)

Review Comment:
   If you want you can declare "int id = 1" here. Inside your arch/ you don't need to follow the C89 since you know that there is an up to date C compiler



##########
arch/risc-v/src/hpmicro/hpm6750/Make.defs:
##########
@@ -0,0 +1,28 @@
+############################################################################
+# arch/risc-v/src/hpm6750/Make.defs
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+include common/Make.defs
+
+# Specify our C code within this directory to be included
+CHIP_CSRCS = hpmicro$(DELIM)hpm6750$(DELIM)hpm_allocateheap.c hpmicro$(DELIM)hpm6750$(DELIM)hpm_clockconfig.c
+CHIP_CSRCS += hpmicro$(DELIM)hpm6750$(DELIM)hpm_irq.c hpmicro$(DELIM)hpm6750$(DELIM)hpm_irq_dispatch.c
+CHIP_CSRCS += hpmicro$(DELIM)hpm6750$(DELIM)hpm_lowputc.c hpmicro$(DELIM)hpm6750$(DELIM)hpm_serial.c
+CHIP_CSRCS += hpmicro$(DELIM)hpm6750$(DELIM)hpm_start.c hpmicro$(DELIM)hpm6750$(DELIM)hpm_timerisr.c
+CHIP_CSRCS += hpmicro$(DELIM)hpm6750$(DELIM)hpm_printf.c

Review Comment:
   You don't need to pass the entire patch, all file are already inside your hpm6750/
   Please look how it is done in other RISC-V chip like arch/risc-v/src/esp32c3/Make.defs



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org