Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: serial_connected_mcu_nucleo rotary_encoder_mbed serial_connected_mcu_nucleo omuni_speed_pid ... more
Fork of rotary_encoder by
Revision 4:d07f58c46a79, committed 2016-04-03
- 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
--- 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 {
