Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of LogUtil by
LogUtil.cpp
00001 /** 00002 * @file LogUtil.cpp 00003 * @brief Utility to log messages during runtime 00004 * @author sam grove 00005 * @version 1.0 00006 * @see http://www.drdobbs.com/cpp/a-lightweight-logger-for-c/240147505 00007 * 00008 * Copyright (c) 2013 00009 * 00010 * Licensed under the Apache License, Version 2.0 (the "License"); 00011 * you may not use this file except in compliance with the License. 00012 * You may obtain a copy of the License at 00013 * 00014 * http://www.apache.org/licenses/LICENSE-2.0 00015 * 00016 * Unless required by applicable law or agreed to in writing, software 00017 * distributed under the License is distributed on an "AS IS" BASIS, 00018 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00019 * See the License for the specific language governing permissions and 00020 * limitations under the License. 00021 */ 00022 00023 #include "LogUtil.h" 00024 #include "mbed.h" 00025 00026 LogUtil::LogUtil(Serial &serial, uint32_t baudrate) 00027 { 00028 _serial = &serial; 00029 (baudrate > 0) ? _serial->baud(baudrate) : __NOP(); 00030 _serial->printf("\033[2J"); // clear the terminal 00031 _serial->printf("\033[1;1H");// and set the cursor to home 00032 wait(0.5f); 00033 return; 00034 } 00035 00036 00037
Generated on Sat Jul 23 2022 11:00:12 by
1.7.2
