Skip to content

Commit b35ad8d

Browse files
committed
include template member functions only once
1 parent e12d5b1 commit b35ad8d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+112
-107
lines changed

examples/Serial/serialio/platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ board = nanoatmega328
4141
framework = arduino
4242
upload_port=/dev/ttyUSB*
4343
upload_flags=-V
44-
build_flags = -DNODEBUG
44+
build_flags = -DNODEBUG -Wno-strict-aliasing -Wno-sign-compare -Wno-write-strings
4545
;
4646
; [env:teensy31]
4747
; platform = teensy

src/items.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "menu.h"
1+
#include "menuDefs.h"
22
using namespace Menu;
33

44
bool prompt::hasTitle(navNode& nav) const {return (nav.target->has(showTitle)||(nav.root->showTitle&&!nav.target->has(noTitle)));}

src/itemsTemplates.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include "menu.h"
3+
#include "menuDefs.h"
44

55
////////////////////////////////////////////////////////////////////////
66
// template implementation

src/menu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "menu.h"
1+
#include "menuDefs.h"
22
using namespace Menu;
33

44
const char* Menu::numericChars="0123456789.";

src/menu.h

Lines changed: 3 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,5 @@
1-
/* -*- C++ -*- */
2-
/********************
3-
Sept 2014 ~ Oct. 2017 Rui Azevedo - ruihfazevedo(@rrob@)gmail.com
1+
#pragma once
42

5-
menu library for the arduino framework
3+
#include "menuDefs.h"
64

7-
www.r-site.net
8-
9-
creative commons license 4.0: CC BY-NC-SA
10-
This software is furnished "as is", without technical support, and with no
11-
warranty, express or implied, as to its usefulness for any purpose.
12-
***/
13-
14-
#ifndef RSITE_ARDUINO_MENU_SYSTEM
15-
#define RSITE_ARDUINO_MENU_SYSTEM
16-
#include <Arduino.h>
17-
// #define MENU_ASYNC
18-
// #define MENU_FMT_WRAPS
19-
20-
#include "menuBase.h"
21-
#include "shadows.h"
22-
23-
using namespace Menu;
24-
25-
#ifdef MENU_DEBUG
26-
String& operator<<(String&s,prompt &p);
27-
Stream& operator<<(Stream&o,prompt& p);
28-
Print& operator<<(Print&o,prompt& p);
29-
#endif
30-
31-
#if defined(MENU_DEBUG) || defined(MENU_ASYNC)
32-
#ifndef ARDUINO_STREAMING
33-
#include <streamFlow.h>
34-
#else
35-
#include <Streaming.h>
36-
#endif
37-
#endif
38-
39-
40-
#if defined(MENU_DEBUG) && defined(TRACE)
41-
#define trace(x) x
42-
#else
43-
#define trace(x)
44-
#endif
45-
#ifdef MENU_DEBUG
46-
#define _trace(x) x
47-
#else
48-
#define _trace(x)
49-
#endif
50-
#ifndef MENU_RELEASE
51-
#define __trace(x) x
52-
#else
53-
#define __trace(x)
54-
#endif
55-
56-
namespace Menu {
57-
extern const char* numericChars;
58-
result maxDepthError(menuOut& o,idleEvent e);
59-
}
60-
61-
#include "items.h"
62-
#include "menuIo.h"
63-
#include "nav.h"
64-
65-
#include "itemsTemplates.cpp"
66-
#endif
5+
#include "itemsTemplates.cpp"

src/menuBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
#include "menu.h"
2+
#include "menuDefs.h"
33

44
using namespace Menu;
55

src/menuDefs.h

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/* -*- C++ -*- */
2+
/********************
3+
Sept 2014 ~ Oct. 2017 Rui Azevedo - ruihfazevedo(@rrob@)gmail.com
4+
5+
menu library for the arduino framework
6+
7+
www.r-site.net
8+
9+
creative commons license 4.0: CC BY-NC-SA
10+
This software is furnished "as is", without technical support, and with no
11+
warranty, express or implied, as to its usefulness for any purpose.
12+
***/
13+
14+
#pragma once
15+
16+
// #ifndef RSITE_ARDUINO_MENU_SYSTEM
17+
// #define RSITE_ARDUINO_MENU_SYSTEM
18+
#include <Arduino.h>
19+
// #define MENU_ASYNC
20+
// #define MENU_FMT_WRAPS
21+
22+
#include "menuBase.h"
23+
#include "shadows.h"
24+
25+
using namespace Menu;
26+
27+
#ifdef MENU_DEBUG
28+
String& operator<<(String&s,prompt &p);
29+
Stream& operator<<(Stream&o,prompt& p);
30+
Print& operator<<(Print&o,prompt& p);
31+
#endif
32+
33+
#if defined(MENU_DEBUG) || defined(MENU_ASYNC)
34+
#ifndef ARDUINO_STREAMING
35+
#include <streamFlow.h>
36+
#else
37+
#include <Streaming.h>
38+
#endif
39+
#endif
40+
41+
42+
#if defined(MENU_DEBUG) && defined(TRACE)
43+
#define trace(x) x
44+
#else
45+
#define trace(x)
46+
#endif
47+
#ifdef MENU_DEBUG
48+
#define _trace(x) x
49+
#else
50+
#define _trace(x)
51+
#endif
52+
#ifndef MENU_RELEASE
53+
#define __trace(x) x
54+
#else
55+
#define __trace(x)
56+
#endif
57+
58+
namespace Menu {
59+
extern const char* numericChars;
60+
result maxDepthError(menuOut& o,idleEvent e);
61+
}
62+
63+
#include "items.h"
64+
#include "menuIo.h"
65+
#include "nav.h"
66+
// #endif

src/menuIO/OzOledAsciiOut.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#ifndef RSITE_ARDUINO_MENU_OZOLEDASCIIOUT
77
#define RSITE_ARDUINO_MENU_OZOLEDASCIIOUT
88

9-
#include "../menu.h"
9+
#include "../menuDefs.h"
1010
// #include <Wire.h>
1111
// #include <LCD.h>
1212

src/menuIO/PCF8574KeyIn.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ PCF8574KeyIn<6> myButton(myBtn_map,Wire);
3131
#ifndef __PCF8574KeyIn_h__
3232
#define __PCF8574KeyIn_h__
3333

34-
#include "../menu.h"
34+
#include "../menuDefs.h"
3535
#include <Wire.h>
3636

3737
namespace Menu {

src/menuIO/PCF8574Out.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#define RSITE_ARDUINO_MENU_PCF8574OUT
77

88
#ifndef ARDUINO_SAM_DUE
9-
#include "../menu.h"
9+
#include "../menuDefs.h"
1010
#include <Wire.h>
1111
#include <LiquidCrystal_PCF8574.h>
1212

0 commit comments

Comments
 (0)