Skip to content

Commit

Permalink
Clean up of configurations. #36.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengtmartensson committed Nov 26, 2017
1 parent f93a146 commit 07e882d
Show file tree
Hide file tree
Showing 27 changed files with 313 additions and 382 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ xml/index.xml: $(DOXYFILE)

lib: libGirs.a

INCLUDES=-I$(INFRARED4ARDUINO_DIR)/src -Isrc/config
VPATH=src src/GirsLib src/IrNamedCommand
INCLUDES=-I$(INFRARED4ARDUINO_DIR)/src -Isrc
VPATH=src src/GirsLib examples/Girs

#.PRECIOUS: test1

# TODO: compile Girs.o separately, in tests/Girs
OBJS=Girs.o GirsUtils.o LedLcdManager.o Tokenizer.o

libGirs.a: $(OBJS)
Expand Down
4 changes: 2 additions & 2 deletions examples/Girs/Girs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -893,8 +893,8 @@ void loop() {

#ifndef ARDUINO
int main() {
girs_setup();
setup();
while (true)
girs_loop();
loop();
}
#endif
116 changes: 31 additions & 85 deletions examples/Girs/GirsFat.config.h
Original file line number Diff line number Diff line change
@@ -1,74 +1,42 @@
// Configuration options

#ifndef CONFIG_H
#define CONFIG_H

// Define for IrScrutinizer/Lirc optimized version
//#define GIRSLITE

// Define Girs modules to implement, see http://www.harctoolbox.org/Girs.html
#ifdef GIRSLITE
#pragma once

// Displayed in greeting messages
#define PROGNAME "GirsLite"
#define PROGNAME "AGirs"

// VERSION is defined in Girs[Lite].cpp; should normally not be changed here.
// VERSION is defined in GirsLib/version.h,
// (which is generated from library.properties),
// and should normally not be changed here.

// Define Girs modules to implement, see http://www.harctoolbox.org/Girs.html

// Transmit IR signals, requires IR Leds.
#define TRANSMIT

// Render some known protocols, presently NEC1 and RC%
#define RENDERER

// Capture IR signals, requires non-demodulating IR sensor (TSMP58000, QSE159, etc)
#define CAPTURE

// Receive demodulated IR signals, require demodulating IR sensor (TSMP* or equivalent)
#define RECEIVE

//#define DECODER
//#define DECODELED

// LCD display with I2C connection. Defines a command "lcd".
#define LCD

// Use LEDs & define command "led"
#define LED

// Allow to change the parameters, like timeouts
#define PARAMETERS

// Support sending signals without modulation, e.g. with RF module.
//#define NON_MOD

// Defines command "memory" reporting free (SRAM) memory.
//#define FREEMEM

#ifdef LED

#ifdef TRANSMIT
// Light this led when transmission is taking place
#define TRANSMITLED 4
#endif

#ifdef RECEIVE
// Light this when receive is pending
#define RECEIVELED 3
#endif

#ifdef CAPTURE
// Light this when capture is pending
#define CAPTURELED 3
#endif

// Light this when listening for command on the input stream
#define COMMANDLED 2

#endif // LED

#else // ! GIRSLITE

#define PROGNAME "AGirs"

#define TRANSMIT
#define RENDERER
#define CAPTURE
#define RECEIVE
#define DECODER
#define DECODELED
#define PARAMETERS
#define LISTEN
// Allow commands to be called by names, grouped in "remotes"
// (Not yet implemented.)
//#define NAMED_COMMANDS

// Define to have the receive command report the duration, even if DECODE is defined
Expand All @@ -78,19 +46,13 @@
// Have parameters for transmitled etc.
#define CONFIGURABLE_LEDS

// LCD display with I2C connection. Defines a command "lcd".
#define LCD

// implements a command "led".
#define LED

// Support sending signals without modulation, e.g. with RF module.
#define NON_MOD
//#define NON_MOD

// Reset command, use at own risk
#define RESET

// Report free memory (for debugging). Command "memory".
// Defines command "memory" reporting free (SRAM) memory.
#define FREEMEM

// Command "info"
Expand Down Expand Up @@ -125,8 +87,6 @@

#endif // LED

#endif // ! GIRSLITE

// Define if using Ethernet (TCP) as the communication channel
//#define ETHERNET

Expand Down Expand Up @@ -164,24 +124,6 @@

// Hardware configuration

// Include one file describing the pin configuration
// Use one provided, or write your own.
//#ifdef ARDUINO
//#ifdef ARDUINO_AVR_MEGA2560
//#include "../hardware-config/girs_pins_mega2560_rear.h"
//#else
//#include "../hardware-config/girs_pins.h" // Generic
//#endif
//#else // ! ARDUINO
//// For compiling a version to test on the PC, not to flash onto the Arduino.
//#include "../hardware-config/girs_pins_dummy.h"
//#endif
//
//// If LCD support desired, include appropriate hardware description
//#ifdef LCD
//#include "../hardware-config/lcd_0x3F_20_4.h"
//#endif // ! LCD

#ifdef ETHERNET
#ifndef SERVER
// Host the program tries to contact
Expand All @@ -201,20 +143,26 @@
#define PORT 33333
#endif // ETHERNET

#if defined(ARDUINO_AVR_MEGA2560)
#define LARGE_RAM
#endif


// Character that ends the command lines
#define EOLCHAR '\r'

// Hardware configuration

// Define an LCD symbol to use
#ifdef LCD
#define LCD_0x3F_20_4
//#define LCD_0x27_20_4
//#define LCD_0x27_16_2
#endif // LCD

// Include one file describing the pin configuration
// Use one of the provided, or write your own.
#include <girs_hw_config.h> // Generic

#if defined(ARDUINO_AVR_MEGA2560)
#define LARGE_RAM
#endif

// Without PARAMETERS, these are really not defaults,
// they are the non-changeable values.
#define DEFAULT_BEGINTIMEOUT 10000UL // milliseconds
Expand Down Expand Up @@ -255,5 +203,3 @@
#define serialBaud 115200
#define serialTimeout 5000L
#endif // !defined(ETHERNET) | defined(SERIAL_DEBUG)

#endif // ! CONFIG_H
49 changes: 40 additions & 9 deletions examples/Girs/GirsLite.config.h
Original file line number Diff line number Diff line change
@@ -1,39 +1,65 @@
// Configuration options

#ifndef CONFIG_H
#define CONFIG_H
#pragma once

// Define for IrScrutinizer/Lirc optimized version
#define GIRSLITE

// Define Girs modules to implement, see http://www.harctoolbox.org/Girs.html
// This is GirsLite, a configuration optimized for IrScrutinizer and Lirc.

// Displayed in greeting messages
#define PROGNAME "GirsLite"

// VERSION is defined in Girs[Lite].cpp; should normally not be changed here.
// VERSION is defined in GirsLib/version.h,
// (which is generated from library.properties),
// and should normally not be changed here.

// Define Girs modules to implement, see http://www.harctoolbox.org/Girs.html

// Transmit IR signals, requires IR Leds.
#define TRANSMIT

// Render some known protocols, presently NEC1 and RC%
#define RENDERER

// Capture IR signals, requires non-demodulating IR sensor (TSMP58000, QSE159, etc)
#define CAPTURE

// Receive demodulated IR signals, require demodulating IR sensor (TSMP* or equivalent)
#define RECEIVE

//#define DECODER
//#define DECODELED

// LCD display with I2C connection. Defines a command "lcd".
//#define LCD

// Use LEDs & define command "led"
#define LED

// Allow to change the parameters, like timeouts
#define PARAMETERS
//#define NAMED_COMMANDS

// Define to have the receive command report the duration, even if DECODE is defined
// and a decode was found. Use this for Lirc.
//#define DONT_REPORT_DECODES

// Have parameters for transmitled etc.
//#define CONFIGURABLE_LEDS

// Support sending signals without modulation, e.g. with RF module.
//#define NON_MOD

// Reset command, use at own risk
//#define RESET

// Defines command "memory" reporting free (SRAM) memory.
//#define FREEMEM

// Command "info"
//#define INFO

// Command "hex", sending Pronto hex signals
//#define PRONTO

#ifdef LED

#ifdef TRANSMIT
Expand Down Expand Up @@ -61,6 +87,13 @@

// Hardware configuration

// Define an LCD symbol to use
#ifdef LCD
#define LCD_0x3F_20_4
//#define LCD_0x27_20_4
//#define LCD_0x27_16_2
#endif // LCD

// Include one file describing the pin configuration
// Use one of the provided, or write your own.
#include <girs_hw_config.h> // Generic
Expand Down Expand Up @@ -88,5 +121,3 @@
#define serialBaud 115200
#define serialTimeout 5000L
#endif // !defined(ETHERNET) | defined(SERIAL_DEBUG)

#endif // ! CONFIG_H
1 change: 1 addition & 0 deletions examples/Girs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO
2 changes: 2 additions & 0 deletions examples/Girs/config.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma once

// This file determines the configuration of the built program.
// Feel free to be creative here; you can include pre-built files, you can replace
// the file with your content, you can include pre-built files and override values in them,
Expand Down
Loading

0 comments on commit 07e882d

Please sign in to comment.