projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kill warnings when !CONFIG_PROC_MONITOR.
[bertos.git]
/
drv
/
eeprom.c
diff --git
a/drv/eeprom.c
b/drv/eeprom.c
index 1729a8949d73394385fae4d16192b5ac691d18e6..81b295888e195e02a1b15a59580161c90097e846 100755
(executable)
--- a/
drv/eeprom.c
+++ b/
drv/eeprom.c
@@
-5,18
+5,23
@@
* All Rights Reserved.
* -->
*
* All Rights Reserved.
* -->
*
- * \version $Id$
- *
- * \author Stefano Fedrigo <aleph@develer.com>
- * \author Bernardo Innocenti <bernie@develer.com>
- *
* \brief Driver for the 24xx16 and 24xx256 I2C EEPROMS (implementation)
*
* \note This implementation is AVR specific.
* \brief Driver for the 24xx16 and 24xx256 I2C EEPROMS (implementation)
*
* \note This implementation is AVR specific.
+ *
+ * \version $Id$
+ * \author Stefano Fedrigo <aleph@develer.com>
+ * \author Bernardo Innocenti <bernie@develer.com>
*/
/*#*
*#* $Log$
*/
/*#*
*#* $Log$
+ *#* Revision 1.10 2004/09/20 03:31:22 bernie
+ *#* Sanitize for C++.
+ *#*
+ *#* Revision 1.9 2004/09/14 21:03:46 bernie
+ *#* Use debug.h instead of kdebug.h.
+ *#*
*#* Revision 1.8 2004/08/25 14:12:08 rasky
*#* Aggiornato il comment block dei log RCS
*#*
*#* Revision 1.8 2004/08/25 14:12:08 rasky
*#* Aggiornato il comment block dei log RCS
*#*
@@
-46,7
+51,7
@@
#include "eeprom.h"
#include <mware/byteorder.h> /* cpu_to_be16() */
#include "eeprom.h"
#include <mware/byteorder.h> /* cpu_to_be16() */
-#include <d
rv/kd
ebug.h>
+#include <debug.h>
#include <hw.h>
#include <macros.h> // MIN()
#include <hw.h>
#include <macros.h> // MIN()
@@
-157,8
+162,10
@@
static void twi_stop(void)
*
* \return true on success, false on error.
*/
*
* \return true on success, false on error.
*/
-static bool twi_send(const
uint8_t *
buf, size_t count)
+static bool twi_send(const
void *_
buf, size_t count)
{
{
+ const uint8_t *buf = (const uint8_t *)_buf;
+
while (count--)
{
TWDR = *buf++;
while (count--)
{
TWDR = *buf++;
@@
-184,8
+191,10
@@
static bool twi_send(const uint8_t *buf, size_t count)
*
* \return true on success, false on error
*/
*
* \return true on success, false on error
*/
-static bool twi_recv(
uint8_t *
buf, size_t count)
+static bool twi_recv(
void *_
buf, size_t count)
{
{
+ uint8_t *buf = (uint8_t *)_buf;
+
/*
* When reading the last byte the TWEA bit is not
* set, and the eeprom should answer with NACK
/*
* When reading the last byte the TWEA bit is not
* set, and the eeprom should answer with NACK
@@
-408,8
+417,8
@@
void eeprom_init(void)
void eeprom_test(void)
{
void eeprom_test(void)
{
- static const char magic[1
3
] = "Humpty Dumpty";
- char buf[sizeof magic
+ 1
];
+ static const char magic[1
4
] = "Humpty Dumpty";
+ char buf[sizeof magic];
size_t i;
// Write something to EEPROM using unaligned sequential writes
size_t i;
// Write something to EEPROM using unaligned sequential writes