controlli aggiunti

Dependents:   MX106-custom

Fork of AX12 by Chris Styles

Files at this revision

API Documentation at this revision

Comitter:
ilaria
Date:
Tue Apr 26 16:26:29 2016 +0000
Parent:
1:93ad80f5fde7
Child:
5:04c4615a2221
Commit message:
aggiunti controlli

Changed in this revision

AX12.cpp Show annotated file Show diff for this revision Revisions of this file
AX12.h Show annotated file Show diff for this revision Revisions of this file
--- a/AX12.cpp	Wed Mar 30 16:08:02 2011 +0000
+++ b/AX12.cpp	Tue Apr 26 16:26:29 2016 +0000
@@ -23,6 +23,7 @@
 
 #include "AX12.h"
 #include "mbed.h"
+#define AX12_DEBUG 1
 
 AX12::AX12(PinName tx, PinName rx, int ID)
         : _ax12(tx,rx) {
@@ -324,7 +325,9 @@
 
     // Transmit the packet in one burst with no pausing
     for (int i = 0; i<8 ; i++) {
+       // printf("Inizio scrittura numero %d\n",i);
         _ax12.putc(TxBuf[i]);
+         //printf("Fine scrittura numero %d\n",i);
     }
 
     // Wait for the bytes to be transmitted
@@ -335,7 +338,9 @@
 
         // Receive the Status packet 6+ number of bytes read
         for (int i=0; i<(6+bytes) ; i++) {
+             printf("Inizio lettura numero %d\n",i);
             Status[i] = _ax12.getc();
+             printf("Fine lettura numero %d\n",i);
         }
 
         // Copy the data from Status into data for return
--- a/AX12.h	Wed Mar 30 16:08:02 2011 +0000
+++ b/AX12.h	Tue Apr 26 16:26:29 2016 +0000
@@ -25,11 +25,11 @@
 #define MBED_AX12_H
 
 #include "mbed.h"
-
-#define AX12_WRITE_DEBUG 0
-#define AX12_READ_DEBUG 0
-#define AX12_TRIGGER_DEBUG 0
-#define AX12_DEBUG 0
+#include "SerialHalfDuplex.h"
+#define AX12_WRITE_DEBUG 1
+#define AX12_READ_DEBUG 1
+#define AX12_TRIGGER_DEBUG 1
+#define AX12_DEBUG 1
 
 #define AX12_REG_ID 0x3
 #define AX12_REG_CW_LIMIT 0x06