affichage fonctionne, valeurs reçues (255)

Dependencies:   mbed

Fork of Main_V3_Old by EI2I_4_projet_1_2017-2018

Committer:
Aureb29
Date:
Mon Jan 15 11:22:40 2018 +0000
Revision:
9:e79b746421b1
Parent:
4:784c4b53a3d4
Main V3

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ChrisnieM 4:784c4b53a3d4 1 /*
ChrisnieM 4:784c4b53a3d4 2 * DebugTrace. Allows dumping debug messages/values to serial or
ChrisnieM 4:784c4b53a3d4 3 * to file.
ChrisnieM 4:784c4b53a3d4 4 *
ChrisnieM 4:784c4b53a3d4 5 * Copyright (C) <2009> Petras Saduikis <petras@petras.co.uk>
ChrisnieM 4:784c4b53a3d4 6 *
ChrisnieM 4:784c4b53a3d4 7 * This file is part of DebugTrace.
ChrisnieM 4:784c4b53a3d4 8 *
ChrisnieM 4:784c4b53a3d4 9 * DebugTrace is free software: you can redistribute it and/or modify
ChrisnieM 4:784c4b53a3d4 10 * it under the terms of the GNU General Public License as published by
ChrisnieM 4:784c4b53a3d4 11 * the Free Software Foundation, either version 3 of the License, or
ChrisnieM 4:784c4b53a3d4 12 * (at your option) any later version.
ChrisnieM 4:784c4b53a3d4 13 *
ChrisnieM 4:784c4b53a3d4 14 * DebugTrace is distributed in the hope that it will be useful,
ChrisnieM 4:784c4b53a3d4 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ChrisnieM 4:784c4b53a3d4 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ChrisnieM 4:784c4b53a3d4 17 * GNU General Public License for more details.
ChrisnieM 4:784c4b53a3d4 18 *
ChrisnieM 4:784c4b53a3d4 19 * You should have received a copy of the GNU General Public License
ChrisnieM 4:784c4b53a3d4 20 * along with DebugTrace. If not, see <http://www.gnu.org/licenses/>.
ChrisnieM 4:784c4b53a3d4 21 */
ChrisnieM 4:784c4b53a3d4 22
ChrisnieM 4:784c4b53a3d4 23 #ifndef SNATCH59_DEBUGTRACE_H
ChrisnieM 4:784c4b53a3d4 24 #define SNATCH59_DEBUGTRACE_H
ChrisnieM 4:784c4b53a3d4 25
ChrisnieM 4:784c4b53a3d4 26 enum eLog {OFF, ON};
ChrisnieM 4:784c4b53a3d4 27 enum eLogTarget {TO_SERIAL, TO_FILE};
ChrisnieM 4:784c4b53a3d4 28
ChrisnieM 4:784c4b53a3d4 29 class DebugTrace
ChrisnieM 4:784c4b53a3d4 30 {
ChrisnieM 4:784c4b53a3d4 31 public:
ChrisnieM 4:784c4b53a3d4 32 DebugTrace(eLog on, eLogTarget mode, const char* fileName = "log.txt", const int maxSize = 1024);
ChrisnieM 4:784c4b53a3d4 33 ~DebugTrace();
ChrisnieM 4:784c4b53a3d4 34
ChrisnieM 4:784c4b53a3d4 35 void clear();
ChrisnieM 4:784c4b53a3d4 36 void traceOut(const char* fmt, ...);
ChrisnieM 4:784c4b53a3d4 37
ChrisnieM 4:784c4b53a3d4 38 private:
ChrisnieM 4:784c4b53a3d4 39 eLog enabled;
ChrisnieM 4:784c4b53a3d4 40 eLogTarget logMode;
ChrisnieM 4:784c4b53a3d4 41 int maxFileSize;
ChrisnieM 4:784c4b53a3d4 42 int currentFileSize;
ChrisnieM 4:784c4b53a3d4 43 char* logFile;
ChrisnieM 4:784c4b53a3d4 44 char* logFileBackup;
ChrisnieM 4:784c4b53a3d4 45 int logFileStatus; // if things go wrong, don't write any more data to file
ChrisnieM 4:784c4b53a3d4 46
ChrisnieM 4:784c4b53a3d4 47 void backupLog();
ChrisnieM 4:784c4b53a3d4 48 };
ChrisnieM 4:784c4b53a3d4 49
ChrisnieM 4:784c4b53a3d4 50 #endif