changeset 3890:775ee0c72c6d

hexo: added default implementations for flash_page_erase and flash_page_write
author Alexandre Becoulet <alexandre.becoulet@free.fr>
date Sun, 22 Apr 2018 18:49:23 +0200
parents d6215e747715
children 5e9e784a7988
files hexo/Makefile hexo/flash.c
diffstat 2 files changed, 38 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hexo/Makefile	Sun Apr 22 17:37:25 2018 +0200
+++ b/hexo/Makefile	Sun Apr 22 18:49:23 2018 +0200
@@ -3,7 +3,7 @@
 
 DIR_CFLAGS = -D_HEXO_INTTYPES_DEPRECATED
 
-objs = cpu.o interrupt.o enum.o atomic.o bit.o
+objs = cpu.o interrupt.o enum.o atomic.o bit.o flash.o
 
 objs-$(CONFIG_HEXO_CONTEXT) += context.o
 objs-$(CONFIG_HEXO_IPI) += ipi.o
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hexo/flash.c	Sun Apr 22 18:49:23 2018 +0200
@@ -0,0 +1,37 @@
+/*
+    This file is part of MutekH.
+    
+    MutekH is free software; you can redistribute it and/or modify it
+    under the terms of the GNU Lesser General Public License as
+    published by the Free Software Foundation; version 2.1 of the
+    License.
+    
+    MutekH is distributed in the hope that it will be useful, but
+    WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+    
+    You should have received a copy of the GNU Lesser General Public
+    License along with MutekH; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+    02110-1301 USA.
+
+    Copyright Alexandre Becoulet <alexandre.becoulet@lip6.fr> (c) 2006
+
+*/
+
+#include <hexo/flash.h>
+
+__attribute__((weak))
+reg_t flash_page_erase(uintptr_t addr)
+{
+  return 1;
+}
+
+__attribute__((weak))
+reg_t flash_page_write(uintptr_t addr,
+                       const uint8_t *data,
+                       size_t size)
+{
+  return 1;
+}