From: Haase Bjoern (PT-BEU/EMT) * [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Hello,
for code portability reasons, I would like to avoid to call explicity the
function pgm_read_byte() like in the following example :
const prog_char array[7] = {0x10,0x20,0x30,0x40,0x50,0x60,0x70};
y =
From: Anton Erasmus [EMAIL PROTECTED]
[...]
I tried to calculate the baud rate on scope, I found I
can't get a exactly number, I can only get an
estimate. Do you know if there's way to set the baud
rate accurately?
Send 0xAA continiously. That way you get a nice
square wave at the baud rate
From: [EMAIL PROTECTED] (Joerg Wunsch)
[EMAIL PROTECTED] wrote:
I would like to display a code version (date/time or incremental
number) during init on an LCD display.
If you're using CVS, you can get the date of the last checkin of
a particular module by
const char foo[] = $Date$;
And
From: Anton Erasmus [EMAIL PROTECTED]
On 14 Sep 2005 at 6:21, John Altstadt wrote:
[...]
%.elf: $(OBJ)
@echo
@echo $(MSG_LINKING) $@
$(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
rm version.o
There is a better way to force the recompile of version.c
From: David Kelly [EMAIL PROTECTED]
[...]
char buffer[4];
uint8_t i;
strncpy_P( buffer, PGM_P(000), 3 );
i = 2;
while(x) {
buffer[i--] = x%10 + '0';
x = x/10;
}
putchar(buffer[0]);
putchar('.');
putchar(buffer[1]);
putchar(buffer[2]);
In
From: David Brown [EMAIL PROTECTED]
- Original Message -
From: Trampas [EMAIL PROTECTED]
I was helping a friend debug some code, he is new to C, using the Keil
version of GCC for ARM. Anyway I found the following:
int i;
i=0;
i=i++;
//i was still zero that
[...]
I'd agree with
From: Bob Paddock [EMAIL PROTECTED]
I thought I'd try this bitmap 'trick' via copypaste of the
#defines and code into the file I was working on, this is what I get:
Name/name.c:692: error: `sXX__' undeclared here (not in a function)
Name/name.c:692: error: initializer element is not
From: Jonathan Goldberg [EMAIL PROTECTED]
Anyone have a good lint configuration file for avr-gcc?
You don't say which lint.
Here's the one I'm using for a current project under Ginpel's PC-lint.
--- begin included file ---
// Compiler definitions
//
c:\lint\lnt\co-gnu3.lnt // 2.95.3
From: Vincent Trouilliez [EMAIL PROTECTED]
[...]
Problem: my function pointers are in an array, within a structure, which
itself is accessed via pointers... oh dear.
[...]
//data type for a menu
struct menu {
.;
.;
int (*fp)()[]; //table to store all the
From: Vincent Trouilliez [EMAIL PROTECTED]
[...]
However, something still causes me trouble apparently
The actual/complete declaration of my menu data type / structure is :
struct menu {
uint8_t options; //options to control the operation of the menu
uint8_t nb;
From: Vincent Trouilliez [EMAIL PROTECTED]
[...]
What more could I possibly want ? Well, there is one thing actually:
the pointer points to a function, any function. However if the item is
actually a sub-menu, then the 'menu_item' structure needs to store a
pointer to a 'menu' structure, so that
From: Vincent Trouilliez [EMAIL PROTECTED]
Hi list,
I have been advised to use CVS when developing programs, but it seems
awkward to set up the server side. While asking around for help, I have
been suggested to give up CVS and use SVN, subversion, instead, and
that it was meant to supplant
From: Patrick Blanchard [EMAIL PROTECTED]
On Fri, 2005-10-07 at 08:24 -0700, Razvan Turiac wrote:
I think I have a compile problem. I am using WinAVR
20050214 and I've got one problem when compiling some
code.
OK, but you need to show us the compiler errors received...
You have to scan
From: David Brown [EMAIL PROTECTED]
[...]
The bug is almost certainly a delay loop variable that is not declared
volatile. The delay function is probably something like:
void shortDelay(void) {
uint8_t n = 50;
while (n--);
}
That (might) work fine with little or no optomisation, but
From: Vincent Trouilliez [EMAIL PROTECTED]
FWIW, I always had good luck with the delay functions in delay.h for
short
hardcoded (usec) delays.
Lucky you ! Other than wanting to avoid all this in-line stuff, the
reason I replaced _delay_us(40) in my lcd routine, by an empty for loop,
is
From: David Kelly [EMAIL PROTECTED]
[...]
People keep saying C isn't fast enough. I don't belive it. First
attempt:
#include avr/io.h
#define CLOCK_B (10)
#define BIT_B (11)
void
myjunk(uint8_t byte) {
uint8_t i;
for( i = 0 ; i 8 ; i++ ) {
PORTA |= CLOCK_B;
From: varsha [EMAIL PROTECTED]
hello all,
i am using avr-gcc (GCC) 3.4.3, and using ATmega16 ,
and writng the code for copying sdram data int flash, in c language.
There are three address bytes and three length bytes for sdram.
At a time i can read 16 bytes from sdram, then i want to decerment
From: [EMAIL PROTECTED]
[...]
#include avr/io.h
int somma(int a, int b)
{
return a+b;
}
int main ()
{ int e = 10;
int r = 1;
r = somma(e,r);
r=r+1;
return r;
}
it's a stupid program.
From: bolet (sent by Nabble.com) [EMAIL PROTECTED]
[...]
The program works OK without optimization. It doesn't work with
optimization (-o1). The code is:
...includes...
const char P_Txt[] PROGMEM = Just a test..;
volatile PGM_P txt= P_Txt;
int main (void)
{
...Init code ... (reg setup
From: MuRaT KaRaDeNiZ [EMAIL PROTECTED]
So
U08 RX485_oldbyte1; is uninitialized data, but compiler also initialize
it to zero, why is it different from inline initialization during
declaration, I expect the compiler just replace the zero with the
initial value i provide?
Because reality is
From: rajeev joshi [EMAIL PROTECTED]
[...]
4.While working on windows which compiler, simulator shpuld use ,right now
i
m having codevision AVR ,AVR studio .
5. But i m not gettin how to work on WINAVR .
What is your goal?
If you have to get a project out, and you have a paid license for
From: Paulo Marques [EMAIL PROTECTED]
Graham Davies wrote:
David Brown wrote:
You are missing a number of points ...
Well, I think we're getting close to complete coverage now!
Well, since we are going for complete coverage, I'll add my 2 cents, then.
You've opened some new cans of
From: Paulo Marques [EMAIL PROTECTED]
Dave Hansen wrote:
[...]
You've opened some new cans of worms here, but I'll only make one small
comment
I was afraid of that (the cans of worms, not your comment) ;)
Thanks for noticing the implied smiley. Looking at what I wrote, I'm not
sure
From: Graham Davies [EMAIL PROTECTED]
Bob Paddock wrote:
[...]
I don't see while(true){} being any different than for(;;){}
in this context, and while(true){} causes the Lint error
of evaluation of constant value boolean.
[...]
I can't see why Lint would consider this an error and for ( ; ;
From: Eric Weddington [EMAIL PROTECTED]
From: Schwichtenberg, Knut [mailto:[EMAIL PROTECTED]
[...]
Eric, the point is not that I don't like the output, but the
case to be
selected should be deterministic. I always thought that a switch
statement would lead to identical results if the
From: Bob Paddock [EMAIL PROTECTED]
[...]
What I've never understood at all is why are characters signed
in any case?What exactly is the meaning of a negative-letter-A?
It's all hysterical raisins.
The earliest C compilers made char signed by default because ASCII only
requires 7 bits,
From: Gerard Marull Paretas [EMAIL PROTECTED]
Paulo Marques:
I think you just answered your own question: if all the variables
involved
are uint16_t, then that is the precision used for all he expression and it
will overflow on the multiplication.
The same happens whether if
From: Graham Davies [EMAIL PROTECTED]
David Brown wrote:
I believe [the compiler] can [change order of ... volatile objects
access].
Obviously it is only legal if such moves do not affect the volatile
accesses themselves. Perhaps someone here who has a better knowledge of
the standards
Date: Fri, 28 Sep 2007 14:21:38 +0530 To: [EMAIL PROTECTED] Subject: Re:
[avr-gcc-list] Problem with delay loop From: [EMAIL PROTECTED] CC:
AVR-GCC-list@nongnu.org Hi, On Fri, 28 Sep 2007 13:42:18 +0530, Klaus
Rudolph [EMAIL PROTECTED] wrote: The code has been optimized. Well
done!
From: [EMAIL PROTECTED]
Hi,
On Mon, 01 Oct 2007 13:02:32 +0530, David Brown [EMAIL PROTECTED] wrote:
Royce Pereira wrote:
So I have to write more 'C' code :) to get the same stuff done, in
the 'new smarter' compiler! Interesting.
Doesn't seem right, some how.
Regards,
From: [EMAIL PROTECTED]
For instance I recovered chips sometimes by using UART traffic because
I had no other hardware at hand: I took a RS232-UART converter, sent a
big file from a terminal emulator (with no particular protocol, just raw
byte sending) and I tried a few times to
From: [EMAIL PROTECTED]
The point I was trying to make (poorly) was that io (and other
variables) that may universally declared volatile, may in fact have
values that need to be used in a non-volatile fashion.
You have same problem with unrollable operations such as:
if (ioport
From: [EMAIL PROTECTED]
2008/7/14 Weddington, Eric [EMAIL PROTECTED]: A 24-bit integer is not
supported by the C language. In theory, support could be added to GCC, but
then it would be considered an extension to the C language. And it would
also be difficult and/or time-consuming to
For a PDP-8, CHAR_BIT would be 12, int could have 24 bits, and long could have
36 or 48, whatever is most convenient/efficient/desired.
For a PDP-15, char and int could be the same 18-bit type, and long could be 36
bits.
On further reflection, you might be able to replace the standard 16
From: dke...@hiwaay.net[...] Notice the starting address of eeprom is 1 byte
above the physical address of start of eeprom because there was some rumor
stating some models of AVR would accidentally trash the first byte under some
circumstances. Perhaps when the rest of the device was wiped
From: dke...@hiwaay.net
On Thu, Feb 05, 2009 at 12:13:37AM -0700, Chris Kuethe wrote:
On Thu, Feb 5, 2009 at 12:10 AM, Schwichtenberg, Knut
wrote:
As far as I know hex values won't work as expected but octal does!
I used:
static char s46[] __attribute__ ((progmem)) = Hei\342gas; /* 46
From: vincent.trouill...@modulonet.fr
[...]
ISO C99, section 6.4.4.4, p3:
the question-mark ?, [..] is representable according to the following table
of escape
sequences: question mark? \?
Interesting. I wonder why the standard deeemd it necessary to provide
an escape sequence for the
From: bernard.fou...@kuantic.com
[...re: volatile use cases...]
fourth case: nasty situations where 'volatile' is only a part of the
solution but does not insure a correct result:
For instance if ISR1 and ISR2 are *nested* ISRs, IsrCounter does not
correctly hold the count of
From: d...@mobilefusioninc.com
[...]
I'm still puzzled as to why the compiler didn't change:
// This takes 53uS at 4 MHz
Bin = ( A / Data_Divisor ) // Data_Divisor is a constant, 32.
into
// This takes 8.9uS at 4 MHz
Bin = ( A 5)
Just guessing, but it may be trying to preserve
From: david.br...@hesbynett.no
[...char vs. signed cahr vs. unsigned char...]
Don't look it up - if you learn the compiler's default behaviour, you
risk writing incorrect code. If it is in any way relevant whether a
char is signed or not, write signed char or unsigned char explicitly
From: j...@uriah.heep.sax.de
Dave Hansen i...@hotmail.com wrote:
In this code=2C the handle_input function falls into an infinite loop if pl=
ain char is signed. This is because key gets promoted (to signed int) befo=
re the comparison with EXIT_KEY (which is already signed int
From: i...@hotmail.com
That would work. Another way is to have get_key return int.
Oops. I mean, of course, make key an int. Having get_key return an int that
is then stored into a char would accomplish... nothing.
Regards,
-=Dave
Express your personality in color!
From: jb@gmx.de:
I'm trying to do rounded (opposed to truncated) integer division with
avr-gcc with using only preprocessor magic. This proves to be difficult:
The current code I'm using is
#define __IDIV(x, y) (long)(((long)x + ((long)y / 2L)) / (long)y)
#define IDIV(x, y)
From: graceindustr...@gmail.com
[...]
So that explains the difference. Seems like there could be a better
error message for this case, 'don't use enum here', alas The
preprocessor does not know anything about types in the language...
Here's a cute/ugly little macro that might help you
You wrote
>>> eeprom_read_block((void *), (const void *)eepLoc, num) ;
What is num?
-=Dave
From: AVR-GCC-list on behalf
of Royce Pereira
Sent: Tuesday, June 9, 2020 8:18 AM
To: avr-gcc-list@nongnu.org
Subject: Saving & retreiving a structure in eeprom
45 matches
Mail list logo