![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
SmartMesh QSL for STM32F4 version
Fork of COG-AD4050_QSL by
millis/millis.cpp@1:b909b8399252, 2018-07-12 (annotated)
- Committer:
- APS_Lab
- Date:
- Thu Jul 12 09:19:12 2018 +0000
- Revision:
- 1:b909b8399252
- Parent:
- 0:8ca1e814a851
SmartMesh for STM32F4 version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
APS_Lab | 0:8ca1e814a851 | 1 | #include "mbed.h" |
APS_Lab | 0:8ca1e814a851 | 2 | #include "millis.h" |
APS_Lab | 0:8ca1e814a851 | 3 | /* |
APS_Lab | 0:8ca1e814a851 | 4 | millis.cpp |
APS_Lab | 0:8ca1e814a851 | 5 | Copyright (c) 2016 Zoltan Hudak <hudakz@inbox.com> |
APS_Lab | 0:8ca1e814a851 | 6 | All rights reserved. |
APS_Lab | 0:8ca1e814a851 | 7 | |
APS_Lab | 0:8ca1e814a851 | 8 | This program is free software: you can redistribute it and/or modify |
APS_Lab | 0:8ca1e814a851 | 9 | it under the terms of the GNU General Public License as published by |
APS_Lab | 0:8ca1e814a851 | 10 | the Free Software Foundation, either version 3 of the License, or |
APS_Lab | 0:8ca1e814a851 | 11 | (at your option) any later version. |
APS_Lab | 0:8ca1e814a851 | 12 | |
APS_Lab | 0:8ca1e814a851 | 13 | This program is distributed in the hope that it will be useful, |
APS_Lab | 0:8ca1e814a851 | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
APS_Lab | 0:8ca1e814a851 | 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
APS_Lab | 0:8ca1e814a851 | 16 | GNU General Public License for more details. |
APS_Lab | 0:8ca1e814a851 | 17 | |
APS_Lab | 0:8ca1e814a851 | 18 | You should have received a copy of the GNU General Public License |
APS_Lab | 0:8ca1e814a851 | 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
APS_Lab | 0:8ca1e814a851 | 20 | */ |
APS_Lab | 0:8ca1e814a851 | 21 | |
APS_Lab | 0:8ca1e814a851 | 22 | volatile unsigned long _millis; |
APS_Lab | 0:8ca1e814a851 | 23 | Ticker t; |
APS_Lab | 0:8ca1e814a851 | 24 | |
APS_Lab | 0:8ca1e814a851 | 25 | void millisStart(void) { |
APS_Lab | 0:8ca1e814a851 | 26 | SysTick_Config(SystemCoreClock / 1000); |
APS_Lab | 0:8ca1e814a851 | 27 | t.attach(&updateMyTicker, 0.001); |
APS_Lab | 0:8ca1e814a851 | 28 | } |
APS_Lab | 0:8ca1e814a851 | 29 | |
APS_Lab | 0:8ca1e814a851 | 30 | //extern "C" void SysTick_Handler(void) { |
APS_Lab | 0:8ca1e814a851 | 31 | // _millis++; |
APS_Lab | 0:8ca1e814a851 | 32 | //} |
APS_Lab | 0:8ca1e814a851 | 33 | |
APS_Lab | 0:8ca1e814a851 | 34 | void updateMyTicker(void) |
APS_Lab | 0:8ca1e814a851 | 35 | { |
APS_Lab | 0:8ca1e814a851 | 36 | _millis++; |
APS_Lab | 0:8ca1e814a851 | 37 | } |
APS_Lab | 0:8ca1e814a851 | 38 | |
APS_Lab | 0:8ca1e814a851 | 39 | |
APS_Lab | 0:8ca1e814a851 | 40 | unsigned long millis(void) { |
APS_Lab | 0:8ca1e814a851 | 41 | return _millis; |
APS_Lab | 0:8ca1e814a851 | 42 | } |
APS_Lab | 0:8ca1e814a851 | 43 | |
APS_Lab | 0:8ca1e814a851 | 44 |