Prius IPM controller

Dependencies:   mbed

Fork of analoghalls5_5 by N K

Revision:
29:cb03760ba9ea
Parent:
27:846c08fb3697
Child:
30:2b6d426f3bfc
--- a/callbacks.cpp	Sat Mar 14 19:18:34 2015 +0000
+++ b/callbacks.cpp	Sat Mar 14 23:42:46 2015 +0000
@@ -12,6 +12,7 @@
     float I_b, I_c, angle, d_filtered, q_filtered, vd, vq;
     dbg_ib = I_b = c->motor->GetCurrentB();
     dbg_ic = I_c = c->motor->GetCurrentC();
+    
     dbg_angle = angle = c->motor->GetPosition();
     
     Clarke(-(I_b + I_c), I_b, &alpha, &beta);
@@ -68,11 +69,7 @@
 }
 
 void debug(Context *c) {
-    //c->serial->printf("%f %f %f %f %f %f\n\r", dbg_d_filtered, dbg_q_filtered, dbg_ref_d, dbg_ref_q, dbg_loop_d, dbg_loop_q);
-    //c->serial->printf("%f %f %f\n\r", dbg_angle, dbg_d_filtered, dbg_q_filtered);
-    int temp = TIM2->SR & 1;  //this checks to see if the UIF (update interrupt flag) is set high.  (page 287)
-    //c->serial->printf("%d %d %d %d %d\n\r", A0, A1, A2, PA_1, PA_4); 
-    c->serial->printf("%d %d\n\r", current1, current2); 
+    c->serial->printf("CR1:%x CR2:%x SMPR1:%x SMPR2:%x\n\r", ADC1->CR1, ADC1->CR2, ADC1->SMPR1, ADC1->SMPR2);
 }
 
 void log(Context *c) {