Library for Modtronix NZ32 STM32 boards, like the NZ32-SC151, NZ32-SB072, NZ32-SE411 and others

Committer:
modtronix-com
Date:
Fri Aug 19 15:52:51 2016 +1000
Revision:
19:42ae82a8f571
Parent:
13:328bfac0e686
Added tag v1.1 for changeset 37e7c8fac8c7

Who changed what in which revision?

UserRevisionLine numberNew contents of line
modtronix-com 7:709130701ac7 1 /**
modtronix-com 7:709130701ac7 2 * File: mx_timer.cpp
modtronix-com 7:709130701ac7 3 *
modtronix-com 7:709130701ac7 4 * Author: Modtronix Engineering - www.modtronix.com
modtronix-com 7:709130701ac7 5 *
modtronix-com 7:709130701ac7 6 * Description:
modtronix-com 7:709130701ac7 7 *
modtronix-com 7:709130701ac7 8 * Software License Agreement:
modtronix-com 7:709130701ac7 9 * This software has been written or modified by Modtronix Engineering. The code
modtronix-com 7:709130701ac7 10 * may be modified and can be used free of charge for commercial and non commercial
modtronix-com 7:709130701ac7 11 * applications. If this is modified software, any license conditions from original
modtronix-com 7:709130701ac7 12 * software also apply. Any redistribution must include reference to 'Modtronix
modtronix-com 7:709130701ac7 13 * Engineering' and web link(www.modtronix.com) in the file header.
modtronix-com 7:709130701ac7 14 *
modtronix-com 7:709130701ac7 15 * THIS SOFTWARE IS PROVIDED IN AN 'AS IS' CONDITION. NO WARRANTIES, WHETHER EXPRESS,
modtronix-com 7:709130701ac7 16 * IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
modtronix-com 7:709130701ac7 17 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE
modtronix-com 7:709130701ac7 18 * COMPANY SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
modtronix-com 7:709130701ac7 19 * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
modtronix-com 7:709130701ac7 20 */
modtronix-com 7:709130701ac7 21
modtronix-com 7:709130701ac7 22 #include "mbed.h"
modtronix-com 7:709130701ac7 23 #include "mx_tick.h"
modtronix-com 7:709130701ac7 24
modtronix-com 7:709130701ac7 25 uint16_t MxTick::countMs = 1000;
modtronix-com 7:709130701ac7 26 int32_t MxTick::tickSec = 0;
modtronix-com 7:709130701ac7 27 int32_t MxTick::tickMs = 0;
modtronix-com 13:328bfac0e686 28 bool MxTick::running = 0;
modtronix-com 7:709130701ac7 29
modtronix-com 7:709130701ac7 30 MxTick::MxTick(bool autoInc) {
modtronix-com 13:328bfac0e686 31 if(running==false) {
modtronix-com 13:328bfac0e686 32 running = true;
modtronix-com 13:328bfac0e686 33 if(autoInc == true) {
modtronix-com 13:328bfac0e686 34 static Ticker tcr;
modtronix-com 13:328bfac0e686 35 tcr.attach_us(&MxTick::increment, 1000);
modtronix-com 13:328bfac0e686 36 }
modtronix-com 7:709130701ac7 37 }
modtronix-com 7:709130701ac7 38 }
modtronix-com 7:709130701ac7 39