mirror of
https://github.com/luc-github/ESP3D.git
synced 2026-03-21 15:16:51 +01:00
Initial commit for code base
This commit is contained in:
39
esp3d/src/core/debug_esp3d.cpp
Normal file
39
esp3d/src/core/debug_esp3d.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
debug_esp3d.cpp - debug esp3d functions class
|
||||
|
||||
Copyright (c) 2014 Luc Lebosse. All rights reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "../include/esp3d_config.h"
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP8266) && (defined(DEBUG_OUTPUT_SERIAL0) || defined(DEBUG_OUTPUT_SERIAL1) || defined(DEBUG_OUTPUT_SERIAL2))
|
||||
#include <Arduino.h>
|
||||
const char * pathToFileName(const char * path)
|
||||
{
|
||||
size_t i = 0;
|
||||
size_t pos = 0;
|
||||
char * p = (char *)path;
|
||||
while(*p) {
|
||||
i++;
|
||||
if(*p == '/' || *p == '\\') {
|
||||
pos = i;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
return path+pos;
|
||||
}
|
||||
#endif //ARDUINO_ARCH_ESP8266 + DEBUG SERIAL0/1/2
|
||||
Reference in New Issue
Block a user