tarou yamada / nucleo_rotary_encoder

Dependents:   serial_connected_mcu_nucleo rotary_encoder_mbed serial_connected_mcu_nucleo omuni_speed_pid ... more

Fork of rotary_encoder by tarou yamada

Files at this revision

API Documentation at this revision

Comitter:
inst
Date:
Sun Apr 03 06:30:19 2016 +0000
Parent:
3:65021ea3fae5
Child:
5:817222abfd86
Child:
6:fae9a340d212
Child:
7:3b51e2c660b6
Commit message:

Changed in this revision

rotary_encoder.hpp Show annotated file Show diff for this revision Revisions of this file
rotary_encoder_base/rotary_encoder_base.cpp Show annotated file Show diff for this revision Revisions of this file
rotary_encoder_base/rotary_encoder_base.hpp Show annotated file Show diff for this revision Revisions of this file
--- a/rotary_encoder.hpp	Thu Mar 31 04:42:31 2016 +0000
+++ b/rotary_encoder.hpp	Sun Apr 03 06:30:19 2016 +0000
@@ -1,7 +1,8 @@
 #ifndef INCLUDED_MBED_STL_ROTARY_ENCODER_H
 #define INCLUDED_MBED_STL_ROTARY_ENCODER_H
 
-#include "mbed.h"
+#include <stdint.h>
+#include <stddef.h>
 
 namespace mbed_stl {
 
--- a/rotary_encoder_base/rotary_encoder_base.cpp	Thu Mar 31 04:42:31 2016 +0000
+++ b/rotary_encoder_base/rotary_encoder_base.cpp	Sun Apr 03 06:30:19 2016 +0000
@@ -7,8 +7,13 @@
 rotary_encoder_base::rotary_encoder_base(TIM_TypeDef* timer_type,
                                         uint32_t encoder_mode,
                                         size_t resolution) : rotary_encoder(resolution) {
-    static size_t cnt = 0;
-    //printf("cnt : %d\n", cnt);
+                                            
+                                            
+    
+    // todo:delete debug
+    encoder_mode = TIM_ENCODERMODE_TI12;
+    resolution = 400;
+    
     
     timer_handler_.Instance              = timer_type;
     timer_handler_.Init.Period           = max_counts_;
@@ -31,11 +36,9 @@
     
     ////////////////////////////////////////
     //printf("t:%d, e:%d", &timer_handler_, &encoder);
-/*
     if (HAL_TIM_Encoder_Init(&timer_handler_, &encoder) != HAL_OK) {
         error("couldn't init encoder\n");
     }
-*/
     //printf("%d end\n", cnt++);
     ///////////////////////////////////////////
 }
--- a/rotary_encoder_base/rotary_encoder_base.hpp	Thu Mar 31 04:42:31 2016 +0000
+++ b/rotary_encoder_base/rotary_encoder_base.hpp	Sun Apr 03 06:30:19 2016 +0000
@@ -1,6 +1,7 @@
 #ifndef INCLUDED_MBED_STL_ROTARY_ENCODER_BASE_H
 #define INCLUDED_MBED_STL_ROTARY_ENCODER_BASE_H
 
+#include "mbed.h"
 #include "rotary_encoder.hpp"
 
 namespace mbed_stl {