Maxim Integrated / MaximInterface

Dependents:   DeepCover Embedded Security in IoT MaximInterface MAXREFDES155#

Committer:
IanBenzMaxim
Date:
Thu Jan 11 13:50:39 2018 -0600
Revision:
3:f818ea5172ed
Updated to version 1.1.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
IanBenzMaxim 3:f818ea5172ed 1 /*******************************************************************************
IanBenzMaxim 3:f818ea5172ed 2 * Copyright (C) 2017 Maxim Integrated Products, Inc., All Rights Reserved.
IanBenzMaxim 3:f818ea5172ed 3 *
IanBenzMaxim 3:f818ea5172ed 4 * Permission is hereby granted, free of charge, to any person obtaining a
IanBenzMaxim 3:f818ea5172ed 5 * copy of this software and associated documentation files (the "Software"),
IanBenzMaxim 3:f818ea5172ed 6 * to deal in the Software without restriction, including without limitation
IanBenzMaxim 3:f818ea5172ed 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
IanBenzMaxim 3:f818ea5172ed 8 * and/or sell copies of the Software, and to permit persons to whom the
IanBenzMaxim 3:f818ea5172ed 9 * Software is furnished to do so, subject to the following conditions:
IanBenzMaxim 3:f818ea5172ed 10 *
IanBenzMaxim 3:f818ea5172ed 11 * The above copyright notice and this permission notice shall be included
IanBenzMaxim 3:f818ea5172ed 12 * in all copies or substantial portions of the Software.
IanBenzMaxim 3:f818ea5172ed 13 *
IanBenzMaxim 3:f818ea5172ed 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
IanBenzMaxim 3:f818ea5172ed 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
IanBenzMaxim 3:f818ea5172ed 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IanBenzMaxim 3:f818ea5172ed 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
IanBenzMaxim 3:f818ea5172ed 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
IanBenzMaxim 3:f818ea5172ed 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
IanBenzMaxim 3:f818ea5172ed 20 * OTHER DEALINGS IN THE SOFTWARE.
IanBenzMaxim 3:f818ea5172ed 21 *
IanBenzMaxim 3:f818ea5172ed 22 * Except as contained in this notice, the name of Maxim Integrated
IanBenzMaxim 3:f818ea5172ed 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
IanBenzMaxim 3:f818ea5172ed 24 * Products, Inc. Branding Policy.
IanBenzMaxim 3:f818ea5172ed 25 *
IanBenzMaxim 3:f818ea5172ed 26 * The mere transfer of this software does not imply any licenses
IanBenzMaxim 3:f818ea5172ed 27 * of trade secrets, proprietary technology, copyrights, patents,
IanBenzMaxim 3:f818ea5172ed 28 * trademarks, maskwork rights, or any other form of intellectual
IanBenzMaxim 3:f818ea5172ed 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
IanBenzMaxim 3:f818ea5172ed 30 * ownership rights.
IanBenzMaxim 3:f818ea5172ed 31 *******************************************************************************/
IanBenzMaxim 3:f818ea5172ed 32
IanBenzMaxim 3:f818ea5172ed 33 #include <QThread>
IanBenzMaxim 3:f818ea5172ed 34 #include "SerialPort.hpp"
IanBenzMaxim 3:f818ea5172ed 35 #include "Sleep.hpp"
IanBenzMaxim 3:f818ea5172ed 36
IanBenzMaxim 3:f818ea5172ed 37 namespace MaximInterface {
IanBenzMaxim 3:f818ea5172ed 38 namespace Qt {
IanBenzMaxim 3:f818ea5172ed 39
IanBenzMaxim 3:f818ea5172ed 40 void sleep(const int ms) {
IanBenzMaxim 3:f818ea5172ed 41 QThread::msleep(ms);
IanBenzMaxim 3:f818ea5172ed 42 }
IanBenzMaxim 3:f818ea5172ed 43
IanBenzMaxim 3:f818ea5172ed 44 Sleep & Sleep::instance() {
IanBenzMaxim 3:f818ea5172ed 45 static Sleep instance;
IanBenzMaxim 3:f818ea5172ed 46 return instance;
IanBenzMaxim 3:f818ea5172ed 47 }
IanBenzMaxim 3:f818ea5172ed 48
IanBenzMaxim 3:f818ea5172ed 49 void Sleep::operator()(int ms) const { sleep(ms); }
IanBenzMaxim 3:f818ea5172ed 50
IanBenzMaxim 3:f818ea5172ed 51 } // namespace Qt
IanBenzMaxim 3:f818ea5172ed 52 } // namespace MaximInterface