Skip to content

Commit

Permalink
Merge branch 'master' of github.com:andysworkshop/stm32plus
Browse files Browse the repository at this point in the history
  • Loading branch information
andysworkshop committed Jul 10, 2016
2 parents dd08dca + 290d523 commit ba772e8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
9 changes: 8 additions & 1 deletion cmake/stm32plus-config.cmake.in
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
include(${CMAKE_CURRENT_LIST_DIR}/stm32plus-config-${STM32PLUS_CONFIGURATION}.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/stm32plus-config-${STM32PLUS_CONFIGURATION}.cmake
OPTIONAL RESULT_VARIABLE STM32PLUS_CONFIG_FILE)

if(NOT "${STM32PLUS_CONFIG_FILE}")
# If we couldn't find the requested config, try with an "e" appended, for
# explicit external oscillator. This config name change was made in 4.0.3.
include(${CMAKE_CURRENT_LIST_DIR}/stm32plus-config-${STM32PLUS_CONFIGURATION}e.cmake)
endif()
16 changes: 1 addition & 15 deletions lib/include/timing/MillisecondTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace stm32plus {

public:
static void initialise();
static void delay(uint32_t millis_);
static void __attribute__ ((weak)) delay(uint32_t millis_);
static uint32_t millis();
static void reset();
static bool hasTimedOut(uint32_t start,uint32_t timeout);
Expand All @@ -42,20 +42,6 @@ namespace stm32plus {
}


/**
* Delay for given time. Waits for the current value of the systick counter to reach a target.
* @param millis The amount of time to wait.
*/

inline void MillisecondTimer::delay(uint32_t millis) {

uint32_t target;

target=_counter+millis;
while(_counter<target);
}


/**
* Reset the counter to zero
*/
Expand Down
14 changes: 14 additions & 0 deletions lib/src/timing/MillisecondTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ namespace stm32plus {
_counter=0;
SysTick_Config(SystemCoreClock / 1000);
}


/**
* Delay for given time. Waits for the current value of the systick counter to reach a target.
* @param millis The amount of time to wait.
*/

void MillisecondTimer::delay(uint32_t millis) {

uint32_t target;

target=_counter+millis;
while(_counter<target);
}
}


Expand Down

0 comments on commit ba772e8

Please sign in to comment.