- Added twe to Makefile, and removed some comments
authoreinsteinnn <einsteinnn@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Wed, 21 Sep 2011 17:58:45 +0000 (17:58 +0000)
committereinsteinnn <einsteinnn@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Wed, 21 Sep 2011 17:58:45 +0000 (17:58 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1051 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

firmware/Makefile
firmware/apps/twe/twe.c
firmware/include/twe.h

index 3dcd605..d25bab4 100644 (file)
@@ -144,6 +144,12 @@ ifeq ($(filter spi, $(config)), spi)
        hdrs+= spi.h
 endif
 
+# include twe app
+ifeq ($(filter twe, $(config)), twe)
+        apps+= apps/twe/twe.o
+        hdrs+= twe.h
+endif
+
 # include base jtag if they specified it explicitly
 ifeq ($(filter jtag, $(config)), jtag)
        ifneq ($(filter apps/jtag/jtag.o, $(apps)), apps/jtag/jtag.o)
index 12a3013..a51818e 100644 (file)
@@ -1,4 +1,4 @@
-/*! \file spi.c
+/*! \file twe.c
   \author EiNSTeiN_ <einstein@g3nius.org>
   \brief Atmel 2-wire EEPROM
 */
@@ -140,10 +140,6 @@ unsigned char twe_rx(unsigned int ack){
     CLRSCL;
     delay_us(15);
   }
-  //~ else {
-    //~ SETSDA;
-  //~ }
-  
   
   return rd;
 }
@@ -161,9 +157,7 @@ void twe_peekblock(uint8_t const app,
   twe_tx(0xa0); // preamble=1010, device adr=000, write=0
   
   // output address bytes
-  //~ debughex((adr >> 8) & 0xff);
   twe_tx((adr >> 8) & 0xff);
-  //~ debughex(adr & 0xff);
   twe_tx(adr & 0xff);
   
   // start command / read
@@ -224,8 +218,6 @@ void twe_setup()
   
   twe_start();
   twe_stop();
-  
-  
 }
 
 //! Handles a monitor command.
index 3d43a8a..dcd6887 100644 (file)
@@ -11,9 +11,6 @@
 #define TWE 0x05
 
 //Pins and I/O
-//~ #define MOSI BIT1
-//~ #define MISO BIT2
-//~ #define SCK  BIT3
 #define SDA BIT1
 #define SCL BIT3
 
@@ -28,13 +25,6 @@ void twe_setup();
 //! Read and write an SPI byte.
 unsigned char twe_trans8(unsigned char byte);
 
-//! Read a block to a buffer.
-//~ void twe_peekblock(uint8_t const app,
-              //~ uint8_t const verb,
-              //~ uint16_t adr,
-              //~ uint32_t len);
-
-
 void twe_handle_fn( uint8_t const app,
                                        uint8_t const verb,
                                        uint32_t const len);