diff 1wire.c @ 13:6f8f7b87d2f1

- Rename 1wire config example to note it's for AVR. - Add STM32 config. - Rework a little to remove AVR depedencies. - Re-do OWProgROM in the no VPP case so it doesn't generate warnings.
author Daniel O'Connor <darius@dons.net.au>
date Tue, 07 Feb 2012 13:53:21 +1030
parents 3879f487b661
children d8002c716678
line wrap: on
line diff
--- a/1wire.c	Thu Jan 06 23:37:15 2011 +1030
+++ b/1wire.c	Tue Feb 07 13:53:21 2012 +1030
@@ -37,12 +37,9 @@
  */
 
 #include <stdio.h>
-#include <avr/io.h>
-#include <avr/pgmspace.h>
-#include <util/delay.h>
+#include <stdint.h>
+#include "1wire-config.h"
 #include "1wire.h"
-#include "1wire-config.h"
-#include "cons.h"
 
 static uint8_t OW_LastDevice = 0;
 static uint8_t OW_LastDiscrepancy = 0;
@@ -78,11 +75,9 @@
      * the delay so we guarantee we don't see a slave from a previous
      * comms attempt
      */
-#if 0
     OWSETREAD();
     if(OWREADBUS() == 0)
 	return 2;
-#endif
 
     OWSETBUSLOW();
     OWDELAY_H;
@@ -431,9 +426,9 @@
  *  3 if the DS2502 didn't respond appropriately (also happens if the
  *  module doesn't exist)
  */
+#if defined(OWSETVPPON) && defined(OWSETVPPOFF)
 uint8_t
 OWProgROM(uint8_t *ROM, uint8_t start, uint8_t len, uint8_t *data, uint8_t exact, uint8_t status) {
-#if defined(OWSETVPPON) && defined(OWSETVPPOFF)
     uint8_t	crc, i, tmp;
     
     /* Stupid programmer detection */
@@ -527,10 +522,13 @@
     }
 
     return(0);
+}
 #else
+uint8_t
+OWProgROM(uint8_t *ROM __attribute((unused)), uint8_t start __attribute((unused)), uint8_t len __attribute((unused)), uint8_t *data __attribute((unused)), uint8_t exact __attribute((unused)), uint8_t status __attribute((unused))) {
     return(1);
+}
 #endif
-}
 
 /* 
  * OWGetTemp