updating code from Flying Laptop
This is the framework of Flying Laptop OBSW version A.13.0.
This commit is contained in:
@ -1,22 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# OSAL makefile
|
||||
#
|
||||
# Created on: Mar 04, 2010
|
||||
# Author: ziemke
|
||||
# Author: Claas Ziemke
|
||||
# Copyright 2010, Claas Ziemke <claas.ziemke@gmx.net>
|
||||
#
|
||||
|
||||
BASEDIR=../../
|
||||
include $(BASEDIR)options.mk
|
||||
|
||||
OBJ = $(BUILDDIR)/OPUSLogger.o
|
||||
|
||||
all: $(OBJ)
|
||||
|
||||
$(BUILDDIR)/%.o: %.cpp %.h
|
||||
$(CPP) $(CFLAGS) $(DEFINES) $(CCOPT) ${INCLUDE} -c $< -o $@
|
||||
|
||||
clean:
|
||||
$(RM) *.o *.gcno *.gcda
|
@ -1,12 +1,9 @@
|
||||
/*
|
||||
* ServiceInterfaceBuffer.cpp
|
||||
*
|
||||
* Created on: 06.08.2015
|
||||
* Author: baetz
|
||||
*/
|
||||
|
||||
#include <framework/osal/OSAL.h>
|
||||
#include <framework/timemanager/Clock.h>
|
||||
#include <framework/serviceinterface/ServiceInterfaceBuffer.h>
|
||||
#include <cstring>
|
||||
|
||||
//TODO Think of something different
|
||||
#include <framework/osal/rtems/Interrupt.h>
|
||||
|
||||
int ServiceInterfaceBuffer::overflow(int c) {
|
||||
// Handle output
|
||||
@ -24,8 +21,8 @@ int ServiceInterfaceBuffer::overflow(int c) {
|
||||
|
||||
int ServiceInterfaceBuffer::sync(void) {
|
||||
if (this->isActive) {
|
||||
TimeOfDay_t loggerTime;
|
||||
OSAL::getDateAndTime(&loggerTime);
|
||||
Clock::TimeOfDay_t loggerTime;
|
||||
Clock::getDateAndTime(&loggerTime);
|
||||
char preamble[96] = { 0 };
|
||||
sprintf(preamble, "%s: | %lu:%02lu:%02lu.%03lu | ",
|
||||
this->log_message.c_str(), (unsigned long) loggerTime.hour,
|
||||
@ -57,16 +54,12 @@ void ServiceInterfaceBuffer::putChars(char const* begin, char const* end) {
|
||||
}
|
||||
memcpy(array, begin, length);
|
||||
|
||||
#ifdef DEBUG
|
||||
if (!OSAL::isInterruptInProgress()) {
|
||||
if (!Interrupt::isInterruptInProgress()) {
|
||||
std::cout << array;
|
||||
} else {
|
||||
//Uncomment the following line if you need ISR debug output.
|
||||
// printk(array);
|
||||
}
|
||||
#else
|
||||
#error Non-DEBUG out messages are not implemented. define DEBUG flag!
|
||||
#endif
|
||||
}
|
||||
#endif //UT699
|
||||
|
||||
@ -95,14 +88,12 @@ void ServiceInterfaceBuffer::putChars(char const* begin, char const* end) {
|
||||
if (udpSocket <= 0) {
|
||||
initSocket();
|
||||
}
|
||||
#ifdef DEBUG
|
||||
|
||||
if (udpSocket > 0) {
|
||||
sendto(udpSocket, array, length, 0, (sockaddr*) &remoteAddress,
|
||||
sizeof(remoteAddress));
|
||||
}
|
||||
#else
|
||||
#error Non-DEBUG out messages are not implemented. define DEBUG flag!
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void ServiceInterfaceBuffer::initSocket() {
|
||||
|
@ -1,10 +1,3 @@
|
||||
/*
|
||||
* ServiceInterfaceBuffer.h
|
||||
*
|
||||
* Created on: 06.08.2015
|
||||
* Author: baetz
|
||||
*/
|
||||
|
||||
#ifndef FRAMEWORK_SERVICEINTERFACE_SERVICEINTERFACEBUFFER_H_
|
||||
#define FRAMEWORK_SERVICEINTERFACE_SERVICEINTERFACEBUFFER_H_
|
||||
|
||||
|
@ -1,11 +1,3 @@
|
||||
/*
|
||||
* ServiceInterfaceStream.cpp
|
||||
*
|
||||
* Created on: 06.08.2015
|
||||
* Author: baetz
|
||||
*/
|
||||
|
||||
|
||||
#include <framework/serviceinterface/ServiceInterfaceStream.h>
|
||||
|
||||
void ServiceInterfaceStream::setActive( bool myActive) {
|
||||
|
@ -1,10 +1,3 @@
|
||||
/*
|
||||
* ServiceInterfaceStream.h
|
||||
*
|
||||
* Created on: 06.08.2015
|
||||
* Author: baetz
|
||||
*/
|
||||
|
||||
#ifndef FRAMEWORK_SERVICEINTERFACE_SERVICEINTERFACESTREAM_H_
|
||||
#define FRAMEWORK_SERVICEINTERFACE_SERVICEINTERFACESTREAM_H_
|
||||
|
||||
|
Reference in New Issue
Block a user