fix build; add debug output

This commit is contained in:
Thomas Kunze 2019-07-09 21:36:32 +02:00
parent 877db57f94
commit dfe000844d
10 changed files with 46 additions and 2639 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +0,0 @@
/**
* @example main.cpp
* @example knx-demo.ino
* @example knx-hdc1008.ino
* @example knx-bme680.ino
*
**/

View File

@ -1,23 +0,0 @@
@manual{knx:3/4/1,
organization = "KNX Association",
title = "KNX System Specifications Chapter 3/4/1 Application Interface Layer",
year = 2013,
month = 12,
note = "v01.01.02"
}
@manual{knx:3/5/1,
organization = "KNX Association",
title = "KNX System Specifications Chapter 3/5/1 Resources",
year = 2013,
month = 12,
note = "v01.09.03"
}
@manual{knx:3/7/3,
organization = "KNX Association",
title = "KNX System Specifications Chapter 3/7/3 Standardized Identifier Tables",
year = 2013,
month = 12,
note = "v01.03.01"
}

View File

@ -1,53 +0,0 @@
import subprocess, os
read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'
breathe_projects = {}
if read_the_docs_build:
subprocess.call('cd ..; wget https://sourceforge.net/projects/plantuml/files/plantuml.jar', shell=True)
subprocess.call('cd .. ; doxygen', shell=True)
breathe_projects['knx'] = '../build/xml'
html_extra_path = ['../build/html']
# -- Project information -----------------------------------------------------
#project = 'knx'
#copyright = '2019, Thomas Kunze'
#author = 'Thomas Kunze'
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
#...
#extensions = [ "breathe" ]
#...
# Add any paths that contain templates here, relative to this directory.
#templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
#exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
#html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static']
# Breathe Configuration
#breathe_default_project = "knx"

View File

@ -1,2 +0,0 @@
.. toctree::
:maxdepth: 2

View File

@ -1 +0,0 @@
breathe

View File

@ -7,9 +7,9 @@
<PathStyle>RemoteUnix</PathStyle>
</CustomSourceDirectories>
<BuildHost>
<HostName>Suzail</HostName>
<Transport>SSH</Transport>
<UserName>tkunze</UserName>
<HostName>localhost</HostName>
<Transport>LinuxSubsystem</Transport>
<UserName>Linux</UserName>
</BuildHost>
<MainSourceTransferCommand>
<SkipWhenRunningCommandList>false</SkipWhenRunningCommandList>
@ -84,11 +84,11 @@
<WorkingDirectory>$(BuildDir)</WorkingDirectory>
<BackgroundMode xsi:nil="true" />
</CMakeCommand>
<UpdateSourcesInCMakeFile>true</UpdateSourcesInCMakeFile>
<UpdateSourcesInCMakeFile>false</UpdateSourcesInCMakeFile>
<ExportCompileCommands>false</ExportCompileCommands>
<DisableToolchainFile>false</DisableToolchainFile>
<DeployAsRoot>false</DeployAsRoot>
<CleanMode>b</CleanMode>
<CMakeCleanMode>RemoveBuildDirectory</CMakeCleanMode>
</Build>
<CustomBuild>
<PreSyncActions />

View File

@ -174,11 +174,11 @@ size_t EspPlatform::readBytesUart(uint8_t *buffer, size_t length)
void print(const char* s)
{
printf("%s", s);
Serial.printf("%s", s);
}
void print(char c)
{
printf("%c", c);
Serial.printf("%c", c);
}
void print(unsigned char num)
@ -189,9 +189,9 @@ void print(unsigned char num)
void print(unsigned char num, int base)
{
if (base == HEX)
printf("%X", num);
Serial.printf("%X", num);
else
printf("%d", num);
Serial.printf("%d", num);
}
void print(int num)
@ -202,9 +202,9 @@ void print(int num)
void print(int num, int base)
{
if (base == HEX)
printf("%X", num);
Serial.printf("%X", num);
else
printf("%d", num);
Serial.printf("%d", num);
}
void print(unsigned int num)
@ -215,9 +215,9 @@ void print(unsigned int num)
void print(unsigned int num, int base)
{
if (base == HEX)
printf("%X", num);
Serial.printf("%X", num);
else
printf("%d", num);
Serial.printf("%d", num);
}
void print(long num)
@ -228,9 +228,9 @@ void print(long num)
void print(long num, int base)
{
if (base == HEX)
printf("%lX", num);
Serial.printf("%lX", num);
else
printf("%ld", num);
Serial.printf("%ld", num);
}
void print(unsigned long num)
@ -241,23 +241,23 @@ void print(unsigned long num)
void print(unsigned long num, int base)
{
if (base == HEX)
printf("%lX", num);
Serial.printf("%lX", num);
else
printf("%ld", num);
Serial.printf("%ld", num);
}
void print(double num)
{
printf("%f", num);
Serial.printf("%f", num);
}
void println(const char* s)
{
printf("%s\n", s);
Serial.printf("%s\n", s);
}
void println(char c)
{
printf("%c\n", c);
Serial.printf("%c\n", c);
}
void println(unsigned char num)
@ -268,9 +268,9 @@ void println(unsigned char num)
void println(unsigned char num, int base)
{
if (base == HEX)
printf("%X\n", num);
Serial.printf("%X\n", num);
else
printf("%d\n", num);
Serial.printf("%d\n", num);
}
void println(int num)
@ -281,9 +281,9 @@ void println(int num)
void println(int num, int base)
{
if (base == HEX)
printf("%X\n", num);
Serial.printf("%X\n", num);
else
printf("%d\n", num);
Serial.printf("%d\n", num);
}
void println(unsigned int num)
@ -294,9 +294,9 @@ void println(unsigned int num)
void println(unsigned int num, int base)
{
if (base == HEX)
printf("%X\n", num);
Serial.printf("%X\n", num);
else
printf("%d\n", num);
Serial.printf("%d\n", num);
}
void println(long num)
@ -307,9 +307,9 @@ void println(long num)
void println(long num, int base)
{
if (base == HEX)
printf("%lX\n", num);
Serial.printf("%lX\n", num);
else
printf("%ld\n", num);
Serial.printf("%ld\n", num);
}
void println(unsigned long num)
@ -320,18 +320,18 @@ void println(unsigned long num)
void println(unsigned long num, int base)
{
if (base == HEX)
printf("%lX\n", num);
Serial.printf("%lX\n", num);
else
printf("%ld\n", num);
Serial.printf("%ld\n", num);
}
void println(double num)
{
printf("%f\n", num);
Serial.printf("%f\n", num);
}
void println(void)
{
printf("\n");
Serial.printf("\n");
}
#endif

View File

@ -1,4 +1,5 @@
#include "platform.h"
#include "knx/bits.h"
#include <cstdlib>
@ -13,7 +14,12 @@ uint8_t* Platform::allocMemory(size_t size)
uint8_t* address = (uint8_t*)malloc(size);
// if (_memoryReference == 0 || address < _memoryReference)
// _memoryReference = address;
print("MemRef: ");
print((long unsigned int)_memoryReference, HEX);
print(" Mem: ");
print((long unsigned int)address, HEX);
print(" Diff: ");
println((long unsigned int)(address - _memoryReference));
return address;
}
@ -25,7 +31,9 @@ void Platform::freeMemory(uint8_t* ptr)
Platform::Platform()
{
// allocate memory to have a memory reference
_memoryReference = (uint8_t*)malloc(1);
// allocate memory to have a memory reference, substract a bit
_memoryReference = (uint8_t*)malloc(1) - 1024;
free(_memoryReference);
print("MemRef: ");
println((long unsigned int)_memoryReference, HEX);
}

View File

@ -5,6 +5,7 @@
#ifdef ARDUINO_ARCH_SAMD
SamdPlatform platform;
Bau07B0 bau(platform);
#define ICACHE_RAM_ATTR
#elif ARDUINO_ARCH_ESP8266
EspPlatform platform;
Bau57B0 bau(platform);
@ -15,9 +16,9 @@ Bau57B0 bau(platform);
#define attachInterrupt(a, b, c)
#endif
bool _toogleProgMode = false;
#ifndef __linux__
KnxFacade knx(bau);
bool _toogleProgMode = false;
ICACHE_RAM_ATTR void buttonUp()
{
_toogleProgMode = true;
@ -110,7 +111,7 @@ void KnxFacade::loop()
{
if(_toogleProgMode)
{
knx.progMode(!knx.progMode());
progMode(!progMode());
_toogleProgMode = false;
}
_bau.loop();