olikraus/u8glib

Atmel studio 7 errors

TheNightWhisper opened this issue · 6 comments

Hi My friends
I'm trying to make IR remote control receiver using atmega8 u controller, using atmel studio 7,
I've created the main file main.c and included the library header file, but when compiling the project I've get
punch of errors and after googling i found some one recommend changing the main file name from main.c to main.cpp ,and re compile, after doing this really it solve many many issues (and i don't know why ? !),
but i stuck with two errors

1- ID returned 1 Exit Status
2- recipe for target IRRemote.elf failed

so please if any one can help to get the hex file
main.cpp
`
#define recvPin 0
#define outPutPin1 1
#define outPutOin2 2
#include <avr/io.h>
#include "IRremote.h"

int main(void)
{
IRrecv irRecv(recvPin);
decode_results results;
irRecv.enableIRIn();
DDRC=(1<<2|1<<1|0<<0);
while (1)
{
if(irRecv.decode(&results))
{
switch(results.value)
{
case 0xFD00FF:
PORTC=(1<<1);
break;

			  case 0xFD807F:
				PORTC=(1<<2);
			
			break;
	 
		}
	}
}

}

IRremot.h
#ifndef IRremote_h
#define IRremote_h

//------------------------------------------------------------------------------
// The ISR header contains several useful macros the user may wish to use
//
#include "IRremoteInt.h"

//------------------------------------------------------------------------------
// Supported IR protocols
// Each protocol you include costs memory and, during decode, costs time
// Disable (set to 0) all the protocols you do not need/want!
//

#define DECODE_NEC 1
#define SEND_NEC 1

//------------------------------------------------------------------------------
// When sending a Pronto code we request to send either the "once" code
// or the "repeat" code
// If the code requested does not exist we can request to fallback on the
// other code (the one we did not explicitly request)
//
// I would suggest that "fallback" will be the standard calling method
// The last paragraph on this page discusses the rationale of this idea:
// http://www.remotecentral.com/features/irdisp2.htm
//
#define PRONTO_ONCE false
#define PRONTO_REPEAT true
#define PRONTO_FALLBACK true
#define PRONTO_NOFALLBACK false

//------------------------------------------------------------------------------
// An enumerated list of all supported formats
// You do NOT need to remove entries from this list when disabling protocols!
//
typedef
enum {
UNKNOWN = -1,
UNUSED = 0,
RC5,
RC6,
NEC,
SONY,
PANASONIC,
JVC,
SAMSUNG,
WHYNTER,
AIWA_RC_T501,
LG,
SANYO,
MITSUBISHI,
DISH,
SHARP,
DENON,
PRONTO,
LEGO_PF,
}
decode_type_t;

//------------------------------------------------------------------------------
// Set DEBUG to 1 for lots of lovely debug output
//
#define DEBUG 0

//------------------------------------------------------------------------------
// Debug directives
//
#if DEBUG

define DBG_PRINT(...) Serial.print(VA_ARGS)

define DBG_PRINTLN(...) Serial.println(VA_ARGS)

#else

define DBG_PRINT(...)

define DBG_PRINTLN(...)

#endif

//------------------------------------------------------------------------------
// Mark & Space matching functions
//
int MATCH (int measured, int desired) ;
int MATCH_MARK (int measured_ticks, int desired_us) ;
int MATCH_SPACE (int measured_ticks, int desired_us) ;

//------------------------------------------------------------------------------
// Results returned from the decoder
//
class decode_results
{
public:
decode_type_t decode_type; // UNKNOWN, NEC, SONY, RC5, ...
unsigned int address; // Used by Panasonic & Sharp [16-bits]
unsigned long value; // Decoded value [max 32-bits]
int bits; // Number of bits in decoded value
volatile unsigned int *rawbuf; // Raw intervals in 50uS ticks
int rawlen; // Number of records in rawbuf
int overflow; // true iff IR raw code too long
};

//------------------------------------------------------------------------------
// Decoded value for NEC when a repeat code is received
//
#define REPEAT 0xFFFFFFFF

//------------------------------------------------------------------------------
// Main class for receiving IR
//
class IRrecv
{
public:
IRrecv (int recvpin) ;
IRrecv (int recvpin, int blinkpin);

	void  blink13    (int blinkflag) ;
	int   decode     (decode_results *results) ;
	void  enableIRIn ( ) ;
	bool  isIdle     ( ) ;
	void  resume     ( ) ;

private:
	long  decodeHash (decode_results *results) ;
	int   compare    (unsigned int oldval, unsigned int newval) ;

	//......................................................................
	
	//......................................................................

if DECODE_NEC

		bool  decodeNEC        (decode_results *results) ;

endif

} ;

//------------------------------------------------------------------------------
// Main class for sending IR
//
class IRsend
{
public:
#ifdef USE_SOFT_CARRIER

	IRsend(int pin = SEND_PIN)
	{
		sendPin = pin;
	}

#else

	IRsend()
	{
	}

#endif

	void  custom_delay_usec (unsigned long uSecs);
	void  enableIROut 		(int khz) ;
	void  mark        		(unsigned int usec) ;
	void  space       		(unsigned int usec) ;
	void  sendRaw     		(const unsigned int buf[],  unsigned int len,  unsigned int hz) ;

	//......................................................................

	//......................................................................

if SEND_NEC

		void  sendNEC        (unsigned long data,  int nbits) ;

endif

	//......................................................................

#ifdef USE_SOFT_CARRIER
private:
int sendPin;

	unsigned int periodTime;
	unsigned int periodOnTime;
	
	void sleepMicros(unsigned long us);
	void sleepUntilMicros(unsigned long targetTime);

#else
const int sendPin = SEND_PIN;
#endif
} ;

#endif

the generated makefile
################################################

Automatically-generated file. Do not edit!

################################################################################

SHELL := cmd.exe
RM := rm -rf

USER_OBJS :=

LIBS :=
PROJ :=

O_SRCS :=
C_SRCS :=
S_SRCS :=
S_UPPER_SRCS :=
OBJ_SRCS :=
ASM_SRCS :=
PREPROCESSING_SRCS :=
OBJS :=
OBJS_AS_ARGS :=
C_DEPS :=
C_DEPS_AS_ARGS :=
EXECUTABLES :=
OUTPUT_FILE_PATH :=
OUTPUT_FILE_PATH_AS_ARGS :=
AVR_APP_PATH :=$$$AVR_APP_PATH$$$
QUOTE := "
ADDITIONAL_DEPENDENCIES:=
OUTPUT_FILE_DEP:=
LIB_DEP:=
LINKER_SCRIPT_DEP:=

Every subdirectory with source files must be described here

SUBDIRS :=

Add inputs and outputs from these tool invocations to the build variables

C_SRCS +=

PREPROCESSING_SRCS +=

ASM_SRCS +=

OBJS +=

OBJS_AS_ARGS +=

C_DEPS +=

C_DEPS_AS_ARGS +=

OUTPUT_FILE_PATH +=IRRemote.elf

OUTPUT_FILE_PATH_AS_ARGS +=IRRemote.elf

ADDITIONAL_DEPENDENCIES:=

OUTPUT_FILE_DEP:= ./makedep.mk

LIB_DEP+=

LINKER_SCRIPT_DEP+=

AVR32/GNU C Compiler

AVR32/GNU Preprocessing Assembler

AVR32/GNU Assembler

ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
endif

Add inputs and outputs from these tool invocations to the build variables

All Target

all: $(OUTPUT_FILE_PATH) $(ADDITIONAL_DEPENDENCIES)

$(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP) $(LINKER_SCRIPT_DEP)
@echo Building target: $@
@echo Invoking: AVR/GNU Linker : 5.4.0
$(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -Wl,-Map="IRRemote.map" -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--gc-sections -mmcu=atmega8a -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\gcc\dev\atmega8a"
@echo Finished building target: $@
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "IRRemote.elf" "IRRemote.hex"
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex "IRRemote.elf" "IRRemote.eep" || exit 0
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "IRRemote.elf" > "IRRemote.lss"
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O srec -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "IRRemote.elf" "IRRemote.srec"
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-size.exe" "IRRemote.elf"

Other Targets

clean:
-$(RM) $(OBJS_AS_ARGS) $(EXECUTABLES)
-$(RM) $(C_DEPS_AS_ARGS)
rm -rf "IRRemote.elf" "IRRemote.a" "IRRemote.hex" "IRRemote.lss" "IRRemote.eep" "IRRemote.map" "IRRemote.srec" "IRRemote.usersignatures"
`

atme studio 7
this a snap shot of my project

I can support regarding u8g but unfortunately not with irremote.

pls, olikraus, i didn't understand what you mean

This is the u8glib issue tracker. The purpose is to discuss topics related to u8glib.
From what I see, your question is not at all related to u8glib.

many thanks olikraus

This is the u8glib issue tracker. The purpose is to discuss topics related to u8glib.
From what I see, your question is not at all related to u8glib.
so pls where is can ask this question ??