[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] -fssa -fssa-dce
From: |
Jörgen |
Subject: |
[avr-gcc-list] -fssa -fssa-dce |
Date: |
Tue, 30 Jul 2002 13:30:08 -0700 (PDT) |
Enabling the SSA optimization crashes AVR-GCC 3.2.
(i'm running the AVRFreaks ready built one).
The error:
accelR8.c:52: internal compiler error: RTL flag check:
INSN_DEAD_CODE_P used with unexpected rtx code `note'
in mark_all
_insn_unnecessary, at gcc/ssa-dce.c:445
Should I report this as a bug to GCC? Is the AVR-GCC
version a valid one (it says experimental...)?
My compile switches:
$ make
c:/avrgcc/bin/avr-gcc -c -Os -mno-tablejump
-mcall-prologues -Wall -Wstrict-prototypes
-Wa,-ahlms=accelR8.lst -I../../..
/source/jb/ -g -fno-stack-limit -W
-foptimize-register-move -fssa -fssa-dce -save-temps
-v -mmcu=at90s8535 -I. accelR8.c
-o accelR8.o
Reading specs from
c:\avrgcc\bin\..\lib\gcc-lib\avr\3.2\specs
Configured with: ../configure --target=avr
--prefix=/avrgcc --disable-nls --program-prefix=avr-
--exec-prefix=/avrgcc --
enable-languages=c,c++
Thread model: single
gcc version 3.2 20020616 (experimental)
c:\avrgcc\bin\..\lib\gcc-lib\avr\3.2\cc1.exe -E
-quiet -v -I../../../source/jb/ -I. -iprefix
c:\avrgcc\bin\..\lib/gcc-l
ib/avr\3.2\ -D__GNUC__=3 -D__GNUC_MINOR__=2
-D__GNUC_PATCHLEVEL__=0 accelR8.c -Wall
-Wstrict-prototypes -W -mno-tablejum
p -mcall-prologues -mmcu=at90s8535 -fno-stack-limit
-foptimize-register-move -fssa -fssa-dce -Os accelR8.i
ignoring nonexistent directory
"c:/avrgcc/avr/sys-include"
ignoring nonexistent directory
"/avrgcc/avr/sys-include"
#include "..." search starts here:
#include <...> search starts here:
../../../source/jb
.
c:/avrgcc/lib/gcc-lib/avr/3.2/include
c:/avrgcc/avr/include
/avrgcc/include
/avrgcc/lib/gcc-lib/avr/3.2/include
/avrgcc/avr/include
End of search list.
c:\avrgcc\bin\..\lib\gcc-lib\avr\3.2\cc1.exe
-fpreprocessed accelR8.i -quiet -dumpbase accelR8.c
-mno-tablejump -mcall-
prologues -mmcu=at90s8535 -g -Os -Wall
-Wstrict-prototypes -W -version -fno-stack-limit
-foptimize-register-move -fssa -
fssa-dce -o
c:\DOCUME~1\JRGEN~1\LOKALA~1\Temp/ccm2aaaa.s
GNU C version 3.2 20020616 (experimental) (avr)
compiled by GNU C version 2.95.3-6 (mingw
special).
accelR8.c: In function `CPU_Clock_Allocate':
accelR8.c:52: internal compiler error: RTL flag check:
INSN_DEAD_CODE_P used with unexpected rtx code `note'
in mark_all
_insn_unnecessary, at gcc/ssa-dce.c:445
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html>
for instructions.
make: *** [accelR8.o] Error 1
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
# 1 "accelR8.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "accelR8.c"
# 9 "accelR8.c"
# 1 "hardware.h" 1
# 51 "hardware.h"
# 1 "c:/avrgcc/avr/include/io.h" 1 3
# 57 "c:/avrgcc/avr/include/io.h" 3
# 1 "c:/avrgcc/avr/include/io8535.h" 1 3
# 34 "c:/avrgcc/avr/include/io8535.h" 3
# 1 "c:/avrgcc/avr/include/sfr_defs.h" 1 3
# 35 "c:/avrgcc/avr/include/io8535.h" 2 3
# 58 "c:/avrgcc/avr/include/io.h" 2 3
# 52 "hardware.h" 2
# 1 "c:/avrgcc/avr/include/interrupt.h" 1 3
# 41 "c:/avrgcc/avr/include/interrupt.h" 3
extern inline void enable_external_int (unsigned char ints)
{
((*(volatile unsigned char *)((((0x3B) + 0x20)))) = (ints));
}
extern inline void timer_enable_int (unsigned char ints)
{
((*(volatile unsigned char *)((((0x39) + 0x20)))) = (ints));
}
# 53 "hardware.h" 2
# 1 "c:/avrgcc/avr/include/sig-avr.h" 1 3
# 54 "hardware.h" 2
# 1 "c:/avrgcc/avr/include/iomacros.h" 1 3
# 21 "c:/avrgcc/avr/include/iomacros.h" 3
# 1 "c:/avrgcc/avr/include/inttypes.h" 1 3
# 42 "c:/avrgcc/avr/include/inttypes.h" 3
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef int int16_t;
typedef unsigned int uint16_t;
typedef long int32_t;
typedef unsigned long uint32_t;
typedef long long int64_t;
typedef unsigned long long uint64_t;
typedef int16_t intptr_t;
typedef uint16_t uintptr_t;
# 22 "c:/avrgcc/avr/include/iomacros.h" 2 3
# 55 "hardware.h" 2
# 200 "hardware.h"
typedef signed int Voltage_t;
# 351 "hardware.h"
typedef unsigned char bool;
enum {
false = 0,
true = !0
};
# 10 "accelR8.c" 2
# 1 "c:/avrgcc/avr/include/progmem.h" 1 3
# 29 "c:/avrgcc/avr/include/progmem.h" 3
# 1 "c:/avrgcc/avr/include/pgmspace.h" 1 3
# 47 "c:/avrgcc/avr/include/pgmspace.h" 3
# 1 "c:/avrgcc/lib/gcc-lib/avr/3.2/include/stddef.h" 1 3 4
# 201 "c:/avrgcc/lib/gcc-lib/avr/3.2/include/stddef.h" 3 4
typedef unsigned int size_t;
# 48 "c:/avrgcc/avr/include/pgmspace.h" 2 3
# 69 "c:/avrgcc/avr/include/pgmspace.h" 3
typedef void prog_void __attribute__((__progmem__));
typedef char prog_char __attribute__((__progmem__));
typedef unsigned char prog_uchar __attribute__((__progmem__));
typedef int prog_int __attribute__((__progmem__));
typedef long prog_long __attribute__((__progmem__));
typedef long long prog_long_long __attribute__((__progmem__));
# 1 "c:/avrgcc/avr/include/ina90.h" 1 3
# 120 "c:/avrgcc/avr/include/ina90.h" 3
# 1 "c:/avrgcc/avr/include/eeprom.h" 1 3
# 40 "c:/avrgcc/avr/include/eeprom.h" 3
# 1 "c:/avrgcc/lib/gcc-lib/avr/3.2/include/stddef.h" 1 3 4
# 41 "c:/avrgcc/avr/include/eeprom.h" 2 3
# 52 "c:/avrgcc/avr/include/eeprom.h" 3
extern unsigned char eeprom_rb(unsigned int addr);
extern unsigned int eeprom_rw(unsigned int addr);
extern void eeprom_wb(unsigned int addr, unsigned char val);
extern void eeprom_read_block(void *buf, unsigned int addr, size_t n);
# 121 "c:/avrgcc/avr/include/ina90.h" 2 3
# 80 "c:/avrgcc/avr/include/pgmspace.h" 2 3
static inline unsigned char __lpm_inline(unsigned short __addr)
__attribute__((__const__));
static inline unsigned char __lpm_inline(unsigned short __addr)
{
return ({ unsigned short __addr16 = (unsigned short)(__addr); unsigned
char __result; __asm__ ( "lpm" "\n\t" "mov %0, r0" : "=r" (__result) : "z"
(__addr16) : "r0" ); __result; });
}
# 116 "c:/avrgcc/avr/include/pgmspace.h" 3
extern void *memcpy_P(void *, const prog_void *, size_t);
extern char *strcat_P(char *, const prog_char *);
extern int strcmp_P(const char *, const prog_char *) __attribute__((__pure__));
extern char *strcpy_P(char *, const prog_char *);
extern int strcasecmp_P(const char *, const prog_char *)
__attribute__((__pure__));
extern size_t strlen_P(const prog_char *) __attribute__((__const__));
extern int strncmp_P(const char *, const prog_char *, size_t)
__attribute__((__pure__));
extern int strncasecmp_P(const char *, const prog_char *, size_t)
__attribute__((__pure__));
extern char *strncpy_P(char *, const prog_char *, size_t);
# 30 "c:/avrgcc/avr/include/progmem.h" 2 3
# 11 "accelR8.c" 2
# 1 "../../../source/jb/printf_P.h" 1
# 11 "../../../source/jb/printf_P.h"
int _formatted_write_P (const char*fmt0,void put_one_char(char, void *),void
*secret_pointer, ...);
void put_c_in_string (char c, void *ptr);
extern void sendchar(char c);
void put_c_to_sendchar (char c, void *ptr);
extern void dbg_sendchar(char data, void* not_used);
# 12 "accelR8.c" 2
# 1 "../../../source/jb/debug.h" 1
# 13 "accelR8.c" 2
# 1 "../../../source/jb/timers.h" 1
# 46 "../../../source/jb/timers.h"
typedef unsigned short int Milliseconds_t;
typedef unsigned char TimerId_t;
# 1 "timer_ids.h" 1
enum
{
TIMER_LCD_CHARGE_PUMP,
TIMER_READ_ADC,
TIMER_BLUE_LED,
TIMER_TIMER2_STABILIZE,
TIMER_ADXL_PRINT,
TIMER_LAST
};
# 54 "../../../source/jb/timers.h" 2
void Timers_Init(void);
unsigned char Timers_GotoToIdle(void);
# 75 "../../../source/jb/timers.h"
unsigned char Timer_HasExpired(const TimerId_t TimerId);
void Timer_Reset(const TimerId_t TimerId);
# 93 "../../../source/jb/timers.h"
void Timer_Set(const TimerId_t TimerId,const Milliseconds_t Timeout);
# 102 "../../../source/jb/timers.h"
Milliseconds_t Timer_MillisecondsLeft(const TimerId_t TimerId);
# 14 "accelR8.c" 2
# 1 "../../../source/jb/monitor.h" 1
extern void Monitor_SendByte(unsigned char);
void _monitor_ (void);
# 15 "accelR8.c" 2
# 1 "display.h" 1
# 14 "display.h"
void Display_OutChar(char ch);
void Display_SetPos(unsigned char x, unsigned char y);
# 16 "accelR8.c" 2
# 1 "../../../source/jb/i2c.h" 1
# 73 "../../../source/jb/i2c.h"
# 1 "c:/avrgcc/lib/gcc-lib/avr/3.2/include/stdbool.h" 1 3 4
# 74 "../../../source/jb/i2c.h" 2
# 82 "../../../source/jb/i2c.h"
inline void I2C_Init(void);
# 101 "../../../source/jb/i2c.h"
void I2C_SendStartBit(void);
# 135 "../../../source/jb/i2c.h"
_Bool I2C_SendByte(uint8_t byte);
# 158 "../../../source/jb/i2c.h"
uint8_t I2C_GetByte(_Bool lastbyte);
# 179 "../../../source/jb/i2c.h"
void I2C_SendStopBit(void);
# 17 "accelR8.c" 2
# 1 "adxl.h" 1
# 44 "adxl.h"
typedef uint16_t ADXL_TimerTicks_t;
void ADXL_PowerOn(void);
void ADXL_InitMeasure(void);
unsigned char ADXL_MeasurementAvailable(void);
ADXL_TimerTicks_t ADXL_Get0(void);
ADXL_TimerTicks_t ADXL_Get1(void);
ADXL_TimerTicks_t ADXL_GetScale(void);
void ADXL_PowerDown(void);
# 18 "accelR8.c" 2
# 1 "../../../source/jb/rtc.h" 1
# 13 "../../../source/jb/rtc.h"
typedef struct
{
uint16_t year;
uint8_t month;
uint8_t day;
uint8_t hour;
uint8_t minute;
uint8_t seconds;
uint16_t milliseconds;
} Time_t;
void RTC_Init(void);
const Time_t* RTC_Get(void);
void RTC_Set(const Time_t* const Time_p);
void RTC_Increase(uint16_t milliseconds);
# 19 "accelR8.c" 2
static volatile unsigned int ADC_ReadValue;
static volatile Voltage_t LCD_Voltage_Current = 0;
static volatile Voltage_t LCD_Voltage_Set = -900;
static void CPU_Clock_Allocate(void);
static void CPU_Clock_Free(void);
static unsigned char CPU_Clock_IsAllocated(void);
static int8_t ADC_GetMUX(void);
static Voltage_t voltage;
static Milliseconds_t LCD_ChargePumpTimer = 100;
void uart_sendchar(char data, void* not_used);
# 44 "accelR8.c"
static volatile unsigned char cpu_clock_allocs = 0;
static void CPU_Clock_Allocate(void)
{
__asm__ __volatile__ ("cli" ::);
cpu_clock_allocs++;
__asm__ __volatile__ ("sei" ::);
}
static void CPU_Clock_Free(void)
{
__asm__ __volatile__ ("cli" ::);
cpu_clock_allocs--;
__asm__ __volatile__ ("sei" ::);
}
static unsigned char CPU_Clock_IsAllocated(void)
{
return cpu_clock_allocs;
}
# 81 "accelR8.c"
int main(void)
{
{ { (*(volatile unsigned char *)(((0x1A) + 0x20)))=0;(*(volatile
unsigned char *)(((0x17) + 0x20)))=0;(*(volatile unsigned char *)(((0x14) +
0x20)))=0;(*(volatile unsigned char *)(((0x11) + 0x20)))=0; (*(volatile
unsigned char *)(((0x1B) + 0x20)))=~0;(*(volatile unsigned char *)(((0x18) +
0x20)))=~0;(*(volatile unsigned char *)(((0x15) + 0x20)))=~0;(*(volatile
unsigned char *)(((0x12) + 0x20)))=~0; } };
I2C_Init();
{(*(volatile unsigned char *)(((0x1A) + 0x20))) = 0;(*(volatile
unsigned char *)(((0x1B) + 0x20)))=0;};
{ (*(volatile unsigned char *)(((0x14) + 0x20)))|=(1 << (0)) | (1 << (1)) |
(1 << (2)) | (1 << (3)); (*(volatile unsigned char *)(((0x15) + 0x20)))=
((*(volatile unsigned char *)(((0x15) + 0x20))) & ~(1 << (1))) | (1 << (0)) |
(1 << (2)) ; };
do { if (__builtin_constant_p((((0x15) + 0x20)))) do { if
((__builtin_constant_p(((((0x15) + 0x20)))) && (((((0x15) + 0x20)))) < 0x20 +
0x20) && __builtin_constant_p(((3)))) __asm__ __volatile__ ( "sbi %0,%1" : :
"I" ((uint8_t)((((((0x15) + 0x20))))-0x20)), "I" ((uint8_t)(((3)))) ); else
__asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t" "or __tmp_reg__,%1" "\n\t"
"out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x15) + 0x20))))-0x20)), "r"
((uint8_t)((1 << (((3)))))) : "r0" ); } while (0); else (*((volatile uint8_t
*)(((((0x15) + 0x20))) - 0x20 + 0x20))) |= (1 << ((3))); } while (0);
(*(volatile unsigned char *)(((0x11) + 0x20)))|=(1 << (5)) | (1 << (4));
do { if (__builtin_constant_p((((0x12) + 0x20)))) do { if
((__builtin_constant_p(((((0x12) + 0x20)))) && (((((0x12) + 0x20)))) < 0x20 +
0x20) && __builtin_constant_p(((5)))) __asm__ __volatile__ ( "cbi %0,%1" : :
"I" ((uint8_t)((((((0x12) + 0x20))))-0x20)), "I" ((uint8_t)(((5)))) ); else
__asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t" "and __tmp_reg__,%1" "\n\t"
"out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x12) + 0x20))))-0x20)), "r"
((uint8_t)(~(1 << (((5)))))) : "r0" ); } while (0); else (*((volatile uint8_t
*)(((((0x12) + 0x20))) - 0x20 + 0x20))) &= ~(1 << ((5))); } while (0);
do { if (__builtin_constant_p((((0x12) + 0x20)))) do { if
((__builtin_constant_p(((((0x12) + 0x20)))) && (((((0x12) + 0x20)))) < 0x20 +
0x20) && __builtin_constant_p(((4)))) __asm__ __volatile__ ( "cbi %0,%1" : :
"I" ((uint8_t)((((((0x12) + 0x20))))-0x20)), "I" ((uint8_t)(((4)))) ); else
__asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t" "and __tmp_reg__,%1" "\n\t"
"out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x12) + 0x20))))-0x20)), "r"
((uint8_t)(~(1 << (((4)))))) : "r0" ); } while (0); else (*((volatile uint8_t
*)(((((0x12) + 0x20))) - 0x20 + 0x20))) &= ~(1 << ((4))); } while (0);
{ do { if (__builtin_constant_p((((0x11) + 0x20)))) do { if
((__builtin_constant_p(((((0x11) + 0x20)))) && (((((0x11) + 0x20)))) < 0x20 +
0x20) && __builtin_constant_p(((1)))) __asm__ __volatile__ ( "sbi %0,%1" : :
"I" ((uint8_t)((((((0x11) + 0x20))))-0x20)), "I" ((uint8_t)(((1)))) ); else
__asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t" "or __tmp_reg__,%1" "\n\t"
"out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x11) + 0x20))))-0x20)), "r"
((uint8_t)((1 << (((1)))))) : "r0" ); } while (0); else (*((volatile uint8_t
*)(((((0x11) + 0x20))) - 0x20 + 0x20))) |= (1 << ((1))); } while (0); do { if
(__builtin_constant_p((((0x12) + 0x20)))) do { if
((__builtin_constant_p(((((0x12) + 0x20)))) && (((((0x12) + 0x20)))) < 0x20 +
0x20) && __builtin_constant_p(((1)))) __asm__ __volatile__ ( "sbi %0,%1" : :
"I" ((uint8_t)((((((0x12) + 0x20))))-0x20)), "I" ((uint8_t)(((1)))) ); else
__asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t" "or __tmp_reg__,%1" "\n\t"
"out %0,__tmp_reg__" : : "I" ((u!
int8_t)((((((0x12) + 0x20))))-0x20)), "r" ((uint8_t)((1 << (((1)))))) : "r0" );
} while (0); else (*((volatile uint8_t *)(((((0x12) + 0x20))) - 0x20 + 0x20)))
|= (1 << ((1))); } while (0); (*(volatile unsigned char *)(((0x09) + 0x20))) =
(((4000000L)/((9600)*16L))-1); (*(volatile unsigned char *)(((0x0A) + 0x20)))
|= (1 << (4)) | (1 << (3)); };
{do { if (__builtin_constant_p((((0x11) + 0x20)))) do { if
((__builtin_constant_p(((((0x11) + 0x20)))) && (((((0x11) + 0x20)))) < 0x20 +
0x20) && __builtin_constant_p(((2)))) __asm__ __volatile__ ( "cbi %0,%1" : :
"I" ((uint8_t)((((((0x11) + 0x20))))-0x20)), "I" ((uint8_t)(((2)))) ); else
__asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t" "and __tmp_reg__,%1" "\n\t"
"out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x11) + 0x20))))-0x20)), "r"
((uint8_t)(~(1 << (((2)))))) : "r0" ); } while (0); else (*((volatile uint8_t
*)(((((0x11) + 0x20))) - 0x20 + 0x20))) &= ~(1 << ((2))); } while (0);do { if
(__builtin_constant_p((((0x11) + 0x20)))) do { if
((__builtin_constant_p(((((0x11) + 0x20)))) && (((((0x11) + 0x20)))) < 0x20 +
0x20) && __builtin_constant_p(((3)))) __asm__ __volatile__ ( "cbi %0,%1" : :
"I" ((uint8_t)((((((0x11) + 0x20))))-0x20)), "I" ((uint8_t)(((3)))) ); else
__asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t" "and __tmp_reg__,%1" "\n\t"
"out %0,__tmp_reg__" : :!
"I" ((uint8_t)((((((0x11) + 0x20))))-0x20)), "r" ((uint8_t)(~(1 << (((3))))))
: "r0" ); } while (0); else (*((volatile uint8_t *)(((((0x11) + 0x20))) - 0x20
+ 0x20))) &= ~(1 << ((3))); } while (0);do { if (__builtin_constant_p((((0x12)
+ 0x20)))) do { if ((__builtin_constant_p(((((0x12) + 0x20)))) && (((((0x12) +
0x20)))) < 0x20 + 0x20) && __builtin_constant_p(((2)))) __asm__ __volatile__ (
"cbi %0,%1" : : "I" ((uint8_t)((((((0x12) + 0x20))))-0x20)), "I"
((uint8_t)(((2)))) ); else __asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t"
"and __tmp_reg__,%1" "\n\t" "out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x12)
+ 0x20))))-0x20)), "r" ((uint8_t)(~(1 << (((2)))))) : "r0" ); } while (0); else
(*((volatile uint8_t *)(((((0x12) + 0x20))) - 0x20 + 0x20))) &= ~(1 << ((2)));
} while (0);do { if (__builtin_constant_p((((0x12) + 0x20)))) do { if
((__builtin_constant_p(((((0x12) + 0x20)))) && (((((0x12) + 0x20)))) < 0x20 +
0x20) && __builtin_constant_p(((3)))) __asm__ __volatile__ ( "cbi !
%0,%1" : : "I" ((uint8_t)((((((0x12) + 0x20))))-0x20)), "I" ((uint8_t)(((3))))
); else __asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t" "and __tmp_reg__,%1"
"\n\t" "out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x12) + 0x20))))-0x20)),
"r" ((uint8_t)(~(1 << (((3)))))) : "r0" ); } while (0); else (*((volatile
uint8_t *)(((((0x12) + 0x20))) - 0x20 + 0x20))) &= ~(1 << ((3))); } while
(0);do { if (__builtin_constant_p((((0x1B) + 0x20)))) do { if
((__builtin_constant_p(((((0x1B) + 0x20)))) && (((((0x1B) + 0x20)))) < 0x20 +
0x20) && __builtin_constant_p(((0)))) __asm__ __volatile__ ( "cbi %0,%1" : :
"I" ((uint8_t)((((((0x1B) + 0x20))))-0x20)), "I" ((uint8_t)(((0)))) ); else
__asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t" "and __tmp_reg__,%1" "\n\t"
"out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x1B) + 0x20))))-0x20)), "r"
((uint8_t)(~(1 << (((0)))))) : "r0" ); } while (0); else (*((volatile uint8_t
*)(((((0x1B) + 0x20))) - 0x20 + 0x20))) &= ~(1 << ((0))); } while (0);do { if
(__bu!
iltin_constant_p((((0x1A) + 0x20)))) do { if ((__builtin_constant_p(((((0x1A) +
0x20)))) && (((((0x1A) + 0x20)))) < 0x20 + 0x20) &&
__builtin_constant_p(((0)))) __asm__ __volatile__ ( "sbi %0,%1" : : "I"
((uint8_t)((((((0x1A) + 0x20))))-0x20)), "I" ((uint8_t)(((0)))) ); else __asm__
__volatile__ ( "in __tmp_reg__,%0" "\n\t" "or __tmp_reg__,%1" "\n\t" "out
%0,__tmp_reg__" : : "I" ((uint8_t)((((((0x1A) + 0x20))))-0x20)), "r"
((uint8_t)((1 << (((0)))))) : "r0" ); } while (0); else (*((volatile uint8_t
*)(((((0x1A) + 0x20))) - 0x20 + 0x20))) |= (1 << ((0))); } while (0);};
Timers_Init();
# 115 "accelR8.c"
Timer_Set(TIMER_BLUE_LED,500);
Timer_Set(TIMER_READ_ADC,1000);
Timer_Set(TIMER_ADXL_PRINT,0);
Timer_Set(TIMER_LCD_CHARGE_PUMP,0);
CPU_Clock_Allocate();
Timer_Set(TIMER_TIMER2_STABILIZE,700);
__asm__ __volatile__ ("sei" ::);
{do { if (__builtin_constant_p((((0x35) + 0x20)))) do { if
((__builtin_constant_p(((((0x35) + 0x20)))) && (((((0x35) + 0x20)))) < 0x20 +
0x20) && __builtin_constant_p(((6)))) __asm__ __volatile__ ( "cbi %0,%1" : :
"I" ((uint8_t)((((((0x35) + 0x20))))-0x20)), "I" ((uint8_t)(((6)))) ); else
__asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t" "and __tmp_reg__,%1" "\n\t"
"out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x35) + 0x20))))-0x20)), "r"
((uint8_t)(~(1 << (((6)))))) : "r0" ); } while (0); else (*((volatile uint8_t
*)(((((0x35) + 0x20))) - 0x20 + 0x20))) &= ~(1 << ((6))); } while (0);__asm__
__volatile__ ("sleep");};
_formatted_write_P(({static char __c[] __attribute__((__progmem__)) =
("\r\nAtmel AVR (""Jul 30 2002"" ""22:24:02"") up and running...");
__c;}),dbg_sendchar,0);
_formatted_write_P(({static char __c[] __attribute__((__progmem__)) =
("0123456789abcdef\rx\nyz\rp"); __c;}),put_c_to_sendchar,0);
_formatted_write_P(({static char __c[] __attribute__((__progmem__)) =
("\f"); __c;}),put_c_to_sendchar,0);
for(;;)
{
int8_t mux = ADC_GetMUX();
# 168 "accelR8.c"
if (mux == (6))
{
Voltage_t prev = LCD_Voltage_Current;
LCD_Voltage_Current = (((1 + 2) * ((voltage) - (5000)))
/ 1 + (5000));
static Voltage_t delta = 0;
Voltage_t diff = LCD_Voltage_Set - LCD_Voltage_Current;
diff /= 30;
delta /= 10;
LCD_ChargePumpTimer+=diff - delta;
delta = LCD_Voltage_Current - prev;
if (LCD_ChargePumpTimer > 5000) LCD_ChargePumpTimer =
20;
}
if (Timer_HasExpired(TIMER_BLUE_LED))
{
ADXL_TimerTicks_t axis0 = ADXL_Get0();
ADXL_TimerTicks_t scale = ADXL_GetScale();
(*(volatile unsigned char *)(((0x12) + 0x20)))^=(1 << (5));
Timer_Set(TIMER_BLUE_LED,500);
axis0/=10;
scale/=10;
axis0*=100;
axis0/=scale;
}
if (Timer_HasExpired(TIMER_TIMER2_STABILIZE))
{
Timer_Reset(TIMER_TIMER2_STABILIZE);
_formatted_write_P(({static char __c[]
__attribute__((__progmem__)) = ("\r\nTIMER2 stable...\r\n");
__c;}),dbg_sendchar,0);
CPU_Clock_Free();
}
if (Timer_HasExpired(TIMER_ADXL_PRINT))
{
ADXL_TimerTicks_t axis0 = ADXL_Get0();
ADXL_TimerTicks_t scale = ADXL_GetScale();
Timer_Set(TIMER_ADXL_PRINT,1000);
axis0/=10;
scale/=10;
axis0*=100;
axis0/=scale;
}
{
static uint8_t prevSec = 0xff;
const Time_t* time_p = RTC_Get();
if (prevSec != time_p->seconds)
{
_formatted_write_P(({static char __c[]
__attribute__((__progmem__)) = ("\r%02d:%02d:%02d"); __c;}),put_c_to_sendchar,0
,time_p->hour,time_p->minute,time_p->seconds);
}
}
if (Timer_HasExpired(TIMER_READ_ADC))
{
_formatted_write_P(({static char __c[]
__attribute__((__progmem__)) = ("\r\nVlcd:%6dmV tmr:%6dms");
__c;}),uart_sendchar,0, LCD_Voltage_Current, LCD_ChargePumpTimer);
ADC_ReadValue = 0xFFFF;
CPU_Clock_Allocate();
(*(volatile unsigned char *)(((0x06) + 0x20))) = (1 <<
(7));
(*(volatile unsigned char *)(((0x07) +
0x20)))=(((6))&0x07);
do { if (__builtin_constant_p((((0x06) + 0x20)))) do {
if ((__builtin_constant_p(((((0x06) + 0x20)))) && (((((0x06) + 0x20)))) < 0x20
+ 0x20) && __builtin_constant_p(((3)))) __asm__ __volatile__ ( "sbi %0,%1" : :
"I" ((uint8_t)((((((0x06) + 0x20))))-0x20)), "I" ((uint8_t)(((3)))) ); else
__asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t" "or __tmp_reg__,%1" "\n\t"
"out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x06) + 0x20))))-0x20)), "r"
((uint8_t)((1 << (((3)))))) : "r0" ); } while (0); else (*((volatile uint8_t
*)(((((0x06) + 0x20))) - 0x20 + 0x20))) |= (1 << ((3))); } while (0);
do { if (__builtin_constant_p((((0x06) + 0x20)))) do {
if ((__builtin_constant_p(((((0x06) + 0x20)))) && (((((0x06) + 0x20)))) < 0x20
+ 0x20) && __builtin_constant_p(((6)))) __asm__ __volatile__ ( "sbi %0,%1" : :
"I" ((uint8_t)((((((0x06) + 0x20))))-0x20)), "I" ((uint8_t)(((6)))) ); else
__asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t" "or __tmp_reg__,%1" "\n\t"
"out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x06) + 0x20))))-0x20)), "r"
((uint8_t)((1 << (((6)))))) : "r0" ); } while (0); else (*((volatile uint8_t
*)(((((0x06) + 0x20))) - 0x20 + 0x20))) |= (1 << ((6))); } while (0);
Timer_Set(TIMER_READ_ADC,1000);
}
if (Timer_HasExpired(TIMER_LCD_CHARGE_PUMP))
{
(*(volatile unsigned char *)(((0x15) + 0x20)))^=(1 <<
(0)) | (1 << (1)) | (1 << (2));
Timer_Set(TIMER_LCD_CHARGE_PUMP,LCD_ChargePumpTimer);
}
if (Timers_GotoToIdle())
{
if (CPU_Clock_IsAllocated())
{
{do { if (__builtin_constant_p((((0x35) +
0x20)))) do { if ((__builtin_constant_p(((((0x35) + 0x20)))) && (((((0x35) +
0x20)))) < 0x20 + 0x20) && __builtin_constant_p(((5)))) __asm__ __volatile__ (
"cbi %0,%1" : : "I" ((uint8_t)((((((0x35) + 0x20))))-0x20)), "I"
((uint8_t)(((5)))) ); else __asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t"
"and __tmp_reg__,%1" "\n\t" "out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x35)
+ 0x20))))-0x20)), "r" ((uint8_t)(~(1 << (((5)))))) : "r0" ); } while (0); else
(*((volatile uint8_t *)(((((0x35) + 0x20))) - 0x20 + 0x20))) &= ~(1 << ((5)));
} while (0);do { if (__builtin_constant_p((((0x35) + 0x20)))) do { if
((__builtin_constant_p(((((0x35) + 0x20)))) && (((((0x35) + 0x20)))) < 0x20 +
0x20) && __builtin_constant_p(((4)))) __asm__ __volatile__ ( "cbi %0,%1" : :
"I" ((uint8_t)((((((0x35) + 0x20))))-0x20)), "I" ((uint8_t)(((4)))) ); else
__asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t" "and __tmp_reg__,%1" "\n\t" !
"out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x35) + 0x20))))-0x20)), "r"
((uint8_t)(~(1 << (((4)))))) : "r0" ); } while (0); else (*((volatile uint8_t
*)(((((0x35) + 0x20))) - 0x20 + 0x20))) &= ~(1 << ((4))); } while (0);do { if
(__builtin_constant_p((((0x35) + 0x20)))) do { if
((__builtin_constant_p(((((0x35) + 0x20)))) && (((((0x35) + 0x20)))) < 0x20 +
0x20) && __builtin_constant_p(((6)))) __asm__ __volatile__ ( "sbi %0,%1" : :
"I" ((uint8_t)((((((0x35) + 0x20))))-0x20)), "I" ((uint8_t)(((6)))) ); else
__asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t" "or __tmp_reg__,%1" "\n\t"
"out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x35) + 0x20))))-0x20)), "r"
((uint8_t)((1 << (((6)))))) : "r0" ); } while (0); else (*((volatile uint8_t
*)(((((0x35) + 0x20))) - 0x20 + 0x20))) |= (1 << ((6))); } while (0);__asm__
__volatile__ ("sleep");};
}
else {
do { if (__builtin_constant_p((((0x12) +
0x20)))) do { if ((__builtin_constant_p(((((0x12) + 0x20)))) && (((((0x12) +
0x20)))) < 0x20 + 0x20) && __builtin_constant_p(((4)))) __asm__ __volatile__ (
"sbi %0,%1" : : "I" ((uint8_t)((((((0x12) + 0x20))))-0x20)), "I"
((uint8_t)(((4)))) ); else __asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t"
"or __tmp_reg__,%1" "\n\t" "out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x12) +
0x20))))-0x20)), "r" ((uint8_t)((1 << (((4)))))) : "r0" ); } while (0); else
(*((volatile uint8_t *)(((((0x12) + 0x20))) - 0x20 + 0x20))) |= (1 << ((4))); }
while (0);
{ volatile uint16_t i; for (i=1255;i-->0;) {}
do { if (__builtin_constant_p((((0x0A) + 0x20)))) do { if
((__builtin_constant_p(((((0x0A) + 0x20)))) && (((((0x0A) + 0x20)))) < 0x20 +
0x20) && __builtin_constant_p(((3)))) __asm__ __volatile__ ( "cbi %0,%1" : :
"I" ((uint8_t)((((((0x0A) + 0x20))))-0x20)), "I" ((uint8_t)(((3)))) ); else
__asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t" "and __tmp_reg__,%1" "\n\t"
"out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x0A) + 0x20))))-0x20)), "r"
((uint8_t)(~(1 << (((3)))))) : "r0" ); } while (0); else (*((volatile uint8_t
*)(((((0x0A) + 0x20))) - 0x20 + 0x20))) &= ~(1 << ((3))); } while (0); };
((*(volatile unsigned char *)((((0x06) +
0x20)))) = (0));
{do { if (__builtin_constant_p((((0x35) +
0x20)))) do { if ((__builtin_constant_p(((((0x35) + 0x20)))) && (((((0x35) +
0x20)))) < 0x20 + 0x20) && __builtin_constant_p(((5)))) __asm__ __volatile__ (
"sbi %0,%1" : : "I" ((uint8_t)((((((0x35) + 0x20))))-0x20)), "I"
((uint8_t)(((5)))) ); else __asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t"
"or __tmp_reg__,%1" "\n\t" "out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x35) +
0x20))))-0x20)), "r" ((uint8_t)((1 << (((5)))))) : "r0" ); } while (0); else
(*((volatile uint8_t *)(((((0x35) + 0x20))) - 0x20 + 0x20))) |= (1 << ((5))); }
while (0);do { if (__builtin_constant_p((((0x35) + 0x20)))) do { if
((__builtin_constant_p(((((0x35) + 0x20)))) && (((((0x35) + 0x20)))) < 0x20 +
0x20) && __builtin_constant_p(((4)))) __asm__ __volatile__ ( "sbi %0,%1" : :
"I" ((uint8_t)((((((0x35) + 0x20))))-0x20)), "I" ((uint8_t)(((4)))) ); else
__asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t" "or __tmp_reg__,%1" "\n\t"
"out!
%0,__tmp_reg__" : : "I" ((uint8_t)((((((0x35) + 0x20))))-0x20)), "r"
((uint8_t)((1 << (((4)))))) : "r0" ); } while (0); else (*((volatile uint8_t
*)(((((0x35) + 0x20))) - 0x20 + 0x20))) |= (1 << ((4))); } while (0);do { if
(__builtin_constant_p((((0x35) + 0x20)))) do { if
((__builtin_constant_p(((((0x35) + 0x20)))) && (((((0x35) + 0x20)))) < 0x20 +
0x20) && __builtin_constant_p(((6)))) __asm__ __volatile__ ( "sbi %0,%1" : :
"I" ((uint8_t)((((((0x35) + 0x20))))-0x20)), "I" ((uint8_t)(((6)))) ); else
__asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t" "or __tmp_reg__,%1" "\n\t"
"out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x35) + 0x20))))-0x20)), "r"
((uint8_t)((1 << (((6)))))) : "r0" ); } while (0); else (*((volatile uint8_t
*)(((((0x35) + 0x20))) - 0x20 + 0x20))) |= (1 << ((6))); } while (0);__asm__
__volatile__ ("sleep");};
do { if (__builtin_constant_p((((0x0A) +
0x20)))) do { if ((__builtin_constant_p(((((0x0A) + 0x20)))) && (((((0x0A) +
0x20)))) < 0x20 + 0x20) && __builtin_constant_p(((3)))) __asm__ __volatile__ (
"sbi %0,%1" : : "I" ((uint8_t)((((((0x0A) + 0x20))))-0x20)), "I"
((uint8_t)(((3)))) ); else __asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t"
"or __tmp_reg__,%1" "\n\t" "out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x0A) +
0x20))))-0x20)), "r" ((uint8_t)((1 << (((3)))))) : "r0" ); } while (0); else
(*((volatile uint8_t *)(((((0x0A) + 0x20))) - 0x20 + 0x20))) |= (1 << ((3))); }
while (0);
do { if (__builtin_constant_p((((0x12) +
0x20)))) do { if ((__builtin_constant_p(((((0x12) + 0x20)))) && (((((0x12) +
0x20)))) < 0x20 + 0x20) && __builtin_constant_p(((4)))) __asm__ __volatile__ (
"cbi %0,%1" : : "I" ((uint8_t)((((((0x12) + 0x20))))-0x20)), "I"
((uint8_t)(((4)))) ); else __asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t"
"and __tmp_reg__,%1" "\n\t" "out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x12)
+ 0x20))))-0x20)), "r" ((uint8_t)(~(1 << (((4)))))) : "r0" ); } while (0); else
(*((volatile uint8_t *)(((((0x12) + 0x20))) - 0x20 + 0x20))) &= ~(1 << ((4)));
} while (0);
}
}
}
}
void sendchar(char c)
{
Display_OutChar(c);
}
void dbg_sendchar(char data, void* not_used)
{
not_used = not_used;
Monitor_SendByte(data);
}
void uart_sendchar(char data, void* not_used)
{
not_used = not_used;
{ __asm__ __volatile__ ( "L_%=: " "sbis %0,%1" "\n\t" "rjmp L_%=" : :
"I" ((uint8_t)((((0x0B) + 0x20))-0x20)), "I" ((uint8_t)(5)) ); (*(volatile
unsigned char *)(((0x0C) + 0x20))) = (data); };
}
static volatile int8_t adc_mux = -1;
void __vector_14 (void) __attribute__ ((interrupt)); void __vector_14 (void)
{
unsigned int value = ((__builtin_constant_p((((0x04) + 0x20))) &&
((((0x04) + 0x20))) <= 0x40 + 0x20 - (2)) ? ({ uint16_t __t; __asm__
__volatile__ ( "in %A0,%1" "\n\t" "in %B0,(%1)+1" : "=r" (__t) : "M"
((uint8_t)((((0x04) + 0x20))-0x20)) ); __t; }) : (*((volatile uint16_t
*)((((0x04) + 0x20)) - 0x20 + 0x20))));
Voltage_t v = ((value)*(((5000))>>((7))) / (1024>>((7))));
ADC_ReadValue = value;
voltage = v;
adc_mux = ((*(volatile unsigned char *)(((0x07) + 0x20))));
CPU_Clock_Free();
do { if (__builtin_constant_p((((0x06) + 0x20)))) do { if
((__builtin_constant_p(((((0x06) + 0x20)))) && (((((0x06) + 0x20)))) < 0x20 +
0x20) && __builtin_constant_p(((3)))) __asm__ __volatile__ ( "cbi %0,%1" : :
"I" ((uint8_t)((((((0x06) + 0x20))))-0x20)), "I" ((uint8_t)(((3)))) ); else
__asm__ __volatile__ ( "in __tmp_reg__,%0" "\n\t" "and __tmp_reg__,%1" "\n\t"
"out %0,__tmp_reg__" : : "I" ((uint8_t)((((((0x06) + 0x20))))-0x20)), "r"
((uint8_t)(~(1 << (((3)))))) : "r0" ); } while (0); else (*((volatile uint8_t
*)(((((0x06) + 0x20))) - 0x20 + 0x20))) &= ~(1 << ((3))); } while (0);
((*(volatile unsigned char *)((((0x06) + 0x20)))) = (0));
}
static int8_t ADC_GetMUX(void)
{
int8_t temp = adc_mux;
adc_mux = -1;
return temp;
}