Thanks all for the input on switch statement, I appreciate.
On Sun, 01 Mar 2009 14:37:57 +0100
David Brown david.br...@hesbynett.no wrote:
Apart from that, I've a couple of other comments on your code. The
variable names tmp16, tmp32 and tmpS16 are truly awful.
Oh :-) I was just trying to
On Sat, 28 Feb 2009 19:09:13 -0700
Weddington, Eric ewedding...@cso.atmel.com wrote:
So in application code I tend to avoid switch statements for embedded
systems, unless I'm writing throw-away code or the application is trivial.
Oh no ! ;-)
I have only recently got round to using switch
On Sat, 28 Feb 2009 19:24:38 -0700
Weddington, Eric ewedding...@cso.atmel.com wrote:
You wouldn't need *nested* ifs, but an if-else-if structure, or better yet, a
table of function pointers, also known as a dispatch table. Each method
depends on the type of data that you're switching on.
I
On Fri, 27 Feb 2009 22:10:16 +0100
David Brown david.br...@hesbynett.no wrote:
sprintf((A_String + i), %c, 0xff)
has exactly the same effect as:
A_String[i] = 0xff;
A_String[i + 1] = 0x00;
delay_about_1000_processor_cycles();
On Fri, 27 Feb 2009 16:50:57 -0500
David VanHorn d...@mobilefusioninc.com wrote:
As was earlier, and more gently pointed out by Dave, Sprintf was pretty
wasteful.
It worked though, and that's what the programmers here suggested I use.
They are big iron guys, so less sensitive to the costs.
On Wed, 25 Feb 2009 11:05:02 -0500
David VanHorn d...@mobilefusioninc.com wrote:
I am kinda a newbee too, but I will throw my comments. The experts will
come to the rescue soon I am sure ;-)
I have an app on a Mega32L, running at 4 MHz.
in ITEMP,TCNT1H ;Once I've captured the timer value,
On Fri, 20 Feb 2009 08:03:52 +0100 (MET)
j...@uriah.heep.sax.de (Joerg Wunsch) wrote:
Vincent Trouilliez vincent.trouill...@modulonet.fr wrote:
lcd.c:96: error: »asm« undeclared (first use in this function)
That's because you are using a -std setting the prevents GCC from
using its
Hi list,
Like many people I guess, I am using in-lined nop asm statements to
respect the timing of external devices, when toggling their control
lines.
In the case at hand I am driving a text LCD module, and the
Enable line must be pulsed low for 250ns.
void lcd_send_nibble(uint8_t data)
{
...
On Thu, 19 Feb 2009 11:14:40 -0700
Weddington, Eric ewedding...@cso.atmel.com wrote:
If you are using WinAVR 20081205 then you can use one of the new builtin
functions:
void __builtin_avr_delay_cycles(unsigned long __n);
Hmm, sweet !
Unfortunately I am on Linux so no WinAVR for me ! ;-)
--
On Thu, 19 Feb 2009 10:22:23 -0800 (PST)
Parthasaradhi Nayani partha_nay...@yahoo.com wrote:
Hi Vincent,
If I understand correctly, the word volatile itself is to tell the compiler
not to ignore the statement. I am not sure if your statement is correct, but
I have used
asm volatile
Morning,
I am trying to copy part of a buffer into another buffer with memcpy():
memcpy(KLineFrameM1, Buff[2], 66);
... but get a warning about the destination pointer:
ui.c:989: warning: passing argument 1 of ‘memcpy’ discards qualifiers
from pointer target type
KLineFrameM1 is declared and
On Tue, 10 Feb 2009 04:32:36 -0500
Graham Davies ecros...@ecrostech.com wrote:
Vincent Trouilliez wrote:
... get a warning about the destination pointer:
... passing argument 1 of ‘memcpy’ discards qualifiers from pointer target
type
Well, this is a pretty clear warning.
Forgive me
On Tue, 10 Feb 2009 11:45:52 +
Richard F li...@keynet-technology.com wrote:
Hi
Call me a newbie, but is there anything wrong with the following statement?
rtc.time_element.tm_wday = (rtc.time_element.tm_wday 6) ?
a = ( a 6 )
Looks strange. the '' is used to evaluate/test if a
On Tue, 10 Feb 2009 21:54:41 -0700
Weddington, Eric ewedding...@cso.atmel.com wrote:
It is still in the FAQ, and still #1 in the FAQ, in the avr-libc user manual.
It's been that way for many years.
Hmm let mcheck again ! ;-)
O... I can see it ! But I missed it because the FAQ entry
Hello Gents,
I am having problem communicating between main.c and another
file/module, ui.c to name it.
In main.c I set a flag from a timer ISR, every 100ms.
In ui.c I am watching for that flag, but unfortunately it always
reads zero :-/ However if I watch for the flag in main() then it works
Just a quick collective thank you to Dave Hylands and Chris Kuethe who
sorted me out off-list ! :-)
static flag was precisely telling the compiler NOT to share the flag,
extern OTOH does just that. Program works as expected now, thanks
chaps.
--
Vince
On Thu, 05 Feb 2009 07:58:26 +0100
David Brown david.br...@hesbynett.no wrote:
Thanks to all the people who replied while I was away !
An alternative idea is to find an ASCII character that you don't need
otherwise (say, ~), and use it in your strings. Then do on-the-fly
conversion when
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 question mark ?
I do happen to have question marks
On Thu, 5 Feb 2009 20:32:46 +0200
lu...@proxima.alt.za wrote:
Because there is a rather arcane way to represent characters in which
three question marks appear prominently. I recall now that it's
called trigraphs.
Don't look it up, no one in his right mind would take that standard
The problem is that Ubuntu (by default) links sh to dash, and almost all
other Linux distributions link sh to bash.
Not that Ubuntu needs anyone to jump in to defend them but ;-)
as an Ubuntu user since day one, I do vividly remember when they
thoughtfully decided, nearly 3 years ago, to
Hello,
I am using the __DATE__ constant, to display it on screen at power-up.
the screen is a 4x20 LCD, and the string returned by __DATE__ is quite
long: MMM DD .
Is there a way to select a different (shorter in my case) format, or is
it cast in stone ?
I downloaded the heavy GCC 4.3.3 PDF
On Wed, 28 Jan 2009 13:06:47 -0700
Weddington, Eric ewedding...@cso.atmel.com wrote:
The __DATE__ macro is a predefined macro, and you can find it in
the C Preprocessor manual (CPP) which is separate from the GCC manual.
Look under section 3.7.1, Standard Predefined Macros.
Thanks. Seems the
On Wed, 28 Jan 2009 12:10:44 -0800
Dave Hylands dhyla...@gmail.com wrote:
This is really a make question and not a gcc question.
Hmmpf.. yes, then the numerous avr-libc question on this list should
not be there too, I guess ! ;-)
If we do a different list for GCC, CPP, Make files, avr-libc, I
On Wed, 28 Jan 2009 13:33:45 -0700
Stu Bell sb...@dataplay.com wrote:
Check out the SubVersion manual:
http://svnbook.red-bean.com/en/1.5/svn.advanced.props.special.keywords.h
tml
Geez, thanks Stu, hard to make it simpler than that ! :-)
I sure had downloaded a PDf copy of this book, but I
Check out the SubVersion manual:
http://svnbook.red-bean.com/en/1.5/svn.advanced.props.special.keywords.html
mmm, think I got carried away. This isn't helpful for what I want. I
would have to commit for SVN to embed the string in the code, and then
compile. Of course I am not gonna commit
On Wed, 28 Jan 2009 21:50:04 +0100
Torsten Seeboth torsten.seeb...@t-online.de wrote:
http://svnbook.red-bean.com/en/1.5/svn.advanced.props.special.keywords.h
HTTP 404 Error
Come on Torsten, I am sure you spotted the trailing tml on the
following line, just add it manually in the address
On Wed, 28 Jan 2009 12:59:17 -0800
Steven Michalske smichal...@gmail.com wrote:
one suggestion, this doesn't check if the files were modified from
the svn revision.
if you only compile code that is checked in this is fine, if you have
changes in the working copy this poses problems.
Steven Michalske smichal...@gmail.com wrote:
you are assigning it to a string here but gcc sees an integer.
use this:
-DMY_DATE=\`date %y%m%d`\
so that MY_DATE is defined as 090128 (a string) in your code
-DMY_DATE=`date %y%m%d`
gives you MY_DATE as 090128 (an integer) in your code.
On Thu, 22 Jan 2009 10:17:07 -0700
larry barello la...@barello.net wrote:
the compiler is complaining because you have an extra or a missing const
in your structure definitions. There is a mismatch between your flash
declaration and the type of pointer within your struct. Probably adding a
menu.c:44: warning: type qualifiers ignored on function return type
Ignore that one, was just a little bug while I was cutting down the program...
--
Vince
___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
On Sat, 24 Jan 2009 16:33:38 -0700
Weddington, Eric ewedding...@cso.atmel.com wrote:
See attached. No warnings, no errors.
Thanks Eric !
But you have won only half the trophey I am afraid.. you didn't fix the
first warning(s)
menu.c:35: warning: initialization from incompatible pointer type
... where I initialize a pointer with dummy_func
errata, I meant menu_sub not dummy_func of course...
--
Vince, should not listen to music while typing...
___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
On Sat, 24 Jan 2009 17:23:13 -0700
Weddington, Eric ewedding...@cso.atmel.com wrote:
I am using WinAVR 20081205 with AVR GCC 4.3.2.
4.3.2.. yes I intended to upgrade to it, as soon as it's in an
installable state in the Ubuntu 9.04 repo (currently in development). I
pulled the GCC source to try
On Sat, 24 Jan 2009 18:47:40 -0700
Weddington, Eric ewedding...@cso.atmel.com wrote:
Ah, ok, I see now. Sorry that I just gave it a quick glance.
Again, typecasts are all that you need. See attached; no warnings, no errors.
{Item 1 ,(const struct Tmenu*)menu_sub,NULL},
On Sun, 25 Jan 2009 03:20:02 +0100
Vincent Trouilliez vincent.trouill...@modulonet.fr wrote:
Oops, I guess our respective GCC versions don't behave the same again..
adding this type cast gives me a new/different warning:
menu.c:35: warning: type-punning to incomplete type might break
On Sun, 25 Jan 2009 03:37:11 +0100
Vincent Trouilliez vincent.trouill...@modulonet.fr wrote:
Hmm, I switched temporarily from GCC 4.2.2 to 4.3.0, and 4.3.0 doesn't
give any warnings at all... I shall just ignore the warnings from 4.2.2
then. I don't want to move to 4.3.0 as I suspect it had
Hi list,
Problem: I have two typdef's statement, each type contains a pointer to
the other type ! Hmmm
typedef TMenuItem struct {
chartext[20];
TMenu *ptr;
void (*fptr)();
};
typedef TMenu struct {
uint8_t nb;
char
On Wed, 21 Jan 2009 09:14:39 -0700
larry barello la...@barello.net wrote:
Use a struct tag, rather than the typdef tag for your storage type, as:
Thanks Larry.
--
Vince
___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
On Wed, 21 Jan 2009 09:33:43 -0800
Dean Ferreyra dferre...@igc.org wrote:
Also, Vince, do you really mean to use a flexible array for the
items field; i.e., leaving the size of items unspecified?
Yes.. well it's just out of convenience really. When I
define/initialise a structure of that type,
On Wed, 21 Jan 2009 10:14:03 -0800
Dean Ferreyra dferre...@igc.org wrote:
Vincent Trouilliez wrote:
On Wed, 21 Jan 2009 09:33:43 -0800
Dean Ferreyra dferre...@igc.org wrote:
Also, Vince, do you really mean to use a flexible array for the
items field; i.e., leaving the size of items
On Wed, 21 Jan 2009 16:41:37 -0700
larry barello la...@barello.net wrote:
You can't make a flexible typdef. If you did that the compiler would
Ops yes, might be, don't know because to solve my problem I have been
suggested to not use Typedef. Dunnon why I wanted to make a Type ouf of
my
Hi list,
I need a little help from the pros ;-)
I Googled for C tutorials on the net, found a few. They aren't all quite
clear about how to use function pointers, and where they are clear, the
syntax they suggest doesn't appear to work on avr-gcc :-(
I need to call a void/void function through
On Mon, 19 Jan 2009 23:35:26 +0100
Georg-Johann Lay a...@gjlay.de wrote:
int f_call;
f_call = fptr; //load the function via the pointer
Just call it:
fptr(); //call function indirect
Oh thanks, it works now ! :-)
So I had only that part wrong, the declaration and
On Mon, 5 Jan 2009 23:26:13 +0100
Sascha Silbe sascha-ml-uc-avr-...@silbe.org wrote:
Sounds like you copied something from an obfuscating mailing list web
archive into your Makefile, probably with improperly wrapped lines.
Inspect your Makefile closely.
I copied my Makefile below, if someone
thanks Sascha and Preston, you got it right indeed, it was this very
list's archive web front end that replaced the actual option with this
addr...@hidden stuff ! Grrr.
David Kelly wrote:
Vincent, as the original author of your Makefile
Thanks for hearing my call, David ! ;-)
(didn't ge
Hi list (and happy new year to everyone)
The last time I workd on my AVr project it was gcc version 3.x
something, a while ago then. I resuming work on that project now, with
a more current version of gcc (4.3.0), and I notice something new :
Everytime I run make to compile the project, a weird
Preston Wilson pwil...@scopuli.com wrote:
There is a GCC extension that supports binary constants:
http://gcc.gnu.org/onlinedocs/gcc/Binary-constants.html
I have not used it, but I ran across the documentation while looking at
other extensions.
Thanks, I just gave it a try, seems to have
On Thu, 16 Aug 2007 20:34:25 +0100
James Pascoe [EMAIL PROTECTED] wrote:
Hi All,
Apologies for the following question which is very OT, but there is a
good chance you guys can help.
Hi James,
Yes this is off-topic, but it would be perfectly spot on topic on the
sister list of avr-gcc :
Hi list,
I am trying to get started using debugging tools.
I am going to fork some cash for a JTAG ICE at some point in the
coming months, but in the meantime I would like to fiddle with
simulation. I use Insight as a GUI for GDB. From what I understand
and saw so far, I have to install simulavr
Vincent Trouilliez [EMAIL PROTECTED] wrote:
So I could really do with some guidance on setting everything up :-)
Had a look at simulavr's man page, which shed some light.
Seems that simulavr must be started manually, before gdb, and made to
listen to a TCP connection from a GDB server:
I tried
On Sat, 2006-05-13 at 09:28 -0400, Trampas wrote:
I have two external interrupts connected to a quadature encoder, I do
the same operations when either interrupt pin is changed. I was
wondering if it was possible to have one ISR that is called from both
interrupts. If so how do I do it?
On Sat, 2006-05-13 at 09:31 -0700, Larry Barello wrote:
Depending what you are doing, the function, below, will have problems. To
avoid false counts with mechanical jitter [...]
Yes, admittedly, I did get a few problems with jitter at first (though
it was surprisingly usable as is), so I added
On Mon, 2006-04-03 at 12:44 -0500, David Kelly wrote:
Speaking of having built your sources, 3.4.6 complains on gmake
depend:
In file included from ui.h:11,
from menu.h:7,
from main.c:14:
On Fri, 2006-03-31 at 22:05 +, Albert Pion wrote:
How do I get a program listing with my C source code included as comments?
I've tried about everything I can think of (including the --Wa,-alhd option)
but have been unable to get it to work.
I would love to know the answer to that one
On Mon, 2006-04-03 at 12:44 -0500, David Kelly wrote:
Vincent, thats originally my Makefile and object.list should already
contain exactly what you are looking for.
Hi David ! Yes, I still use your Makefile, I quite like it :-)
It makes it very easy to add more files to my project, and
On Fri, 2006-02-10 at 12:18 -0800, Dave wrote:
I'm trying to use a timer in my program. I've looked
into avr-libc's timer/counter sections but the
examples only show how to read/write TCNT1. Are there
any examples showing how to start a timer? How can I
set the rate the timer will be
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--);
}
Correct :-)
actually I did'nt even make it a function, as I use it only in one
place, the
Ian is close to how I would have handled it. I use a union32_t type
a fair bit in my code for no other purpose than to pluck values out
of the middle painlessly.
typedef union union32_t {
Okay, I think I can see the light about unions now, thanks to David
Kelly and Bernard who hammered
For a long time I always put address bit 0 on address pin A0 of the
memory,
bit 1 on A1, etc. But this is not always needed! Especially for a RAM
device where you the AVR is the only one having access, the address
lines
can be swapped as you like. The same holds for the data lines. For
On Fri, 2005-11-04 at 19:53 +0100, Joerg Wunsch wrote:
Vincent Trouilliez [EMAIL PROTECTED] wrote:
Now that I have enabled dwarf-2 and recompiled gcc, I noticed that I
still loose the annotations, if I use the -O3 optimisation flag, but
not if I use -O or -Os.
Keep in mind that -O3
I compiled 3.4.3 ... does 3.4.4 or 4.0 do a better job at it ?
With gcc-3.4.4 and -Os, the compiler loads 4 registers with the 32 bits
value (address) and then use 'sbrs register,2' to perform the test.
Hence it is very fast. It would be faster if it needs only one register
to test
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 that I accidentally realised that _delay_us(40)
Didn't I tell you to poll the LCD's busy bit in the first place?
Wouldn't have had the above problem if you had. :-)
--
David Kelly N4HHE, [EMAIL PROTECTED]
Yes yes, you did ;-)
So I decided to tackle it last night, and I wired the LCD R/W line.
I now poll the Busy Flag successfully,
On Sat, 2005-11-05 at 20:24 +0100, Joerg Wunsch wrote:
Vincent Trouilliez [EMAIL PROTECTED] wrote:
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 that I accidentally realised that _delay_us(40
Alas, the fix is not yet in any released version of avr-libc, I just
checked. So you'd either need to pull the fix straight from CVS (as
all this is just in a header file, the fix would be self-contained,
you don't need more than that file itself), or you gotta wait a bit.
Both, avr-libc
On Fri, 2005-11-04 at 15:20 +0800, Ian Caddy wrote:
Hi Vince,
All your new code is doing is checking that address is non-zero as it is
a logical AND with a non-zero number, which would get optimised out.
I haven't tried this, but it might be better:
unsigned char temp;
temp =
On Fri, 2005-11-04 at 10:17 +0100, Alex Wenger wrote:
Him
Vincent Trouilliez schrieb:
Thank you very much Ian, your code is highly efficient, and does work
perfectly, unlike or . :o) I am in heaven :
temp = (address 16) 0xFF;
28bc: ca 01 movwr24
Now your problem with 'address 0x0004' is a real one: avr-gcc is
not yet very good with 32 bits operators
Well, this way we have nice things to be looking forward to, for
upcoming releases of gcc :-)
(BTW what version of avr-gcc do you use?).
I compiled 3.4.3 ... does 3.4.4 or 4.0
Hi all,
So far I have used the binaries of gcc-avr 3.4.3, that my distro
(Ubuntu) supplies, and it seems it doesn't support the -gdwarf-2 flag.
So I defaulted to just -g as suggest by Joerg back then, but now for the
first time, I really need to use the disassembler listing with all the C
On Fri, Nov 04, 2005 at 02:08:19AM +0100, Vincent Trouilliez wrote:
So far I have used the binaries of gcc-avr 3.4.3, that my distro
(Ubuntu) supplies, and it seems it doesn't support the -gdwarf-2 flag.
Vincent,
Adding --with-dwarf2 to the configure options, when rebuilding
avr
Hello list,
I just ran into a weird problem that I hardly expected.
I wrote a trivial routine that takes a 32bit unsigned int, which holds a
memory address, and shifts the lower 19 bits, out to a port pin (this
feeds cascaded shift registers, that in turn drive the 19 address lines
of a memory
How should I re-word my bit test statement/expression, to cause the
compiler to use these lovely SBRS/C instructions at last ?
Sorry for the noise :-/
Why is it always AFTER I hit the 'send' button, that I suddenly get the
bright idea that stops me pulling my hair ??
I replaced the ''
I put it there http://www.007.org.uk/~vtrouilliez/temp/ it's the one
called object.list.
Something else must be wrong. The backannotated disassembly listing
is also supposed to work with stabs debugging.
What I find (found) strange was that, if you look carefully at the file,
SOME
I replaced the '' operator with the more appropriate '' one works
much better... 5 instructions instead of 115 (3 + 6*18 + 4) for the
previous code.
So that's indeed about 20 times faster. Although I still don't get why
it can't just use one single SBRC/S instruction instead of these 4 cp
On Wed, 2005-11-02 at 00:03 +0100, Jerome Kerdreux wrote:
I'm trying to use the timer 0 on a mega 8. Everything works fine,
(I mean, i can see the timer TCNT0 incrementing) but when I want
to route the interrupt to an handler, I get a infinite reset.
I think that's normal. You forgot
hi whats the best method for timing how long thing is running for. i see
atmega32's have built in 8bit timers, but i'm yet to see any good
examples or explainations of how to use these. thing that would time how
long a funtion has been running for would be perfect.
Hmmm, I don't
On Thu, 2005-10-13 at 21:02 -0500, Patrick Blanchard wrote:
It will probably work, but only until Vincent tries it on his own linux
box (which is different from my linux box(es)) will he be undoubtedly
certain that it works or not. And if it doesn't work, it might get him
so frustrated that he
On Wed, 2005-10-12 at 12:58 -0700, Cullen Newsom wrote:
Does anyone want to tell me all the undocumented* tricks to
getting a working dev environment for avr-gcc on ubuntu with the
stk200 and either it's programmer, or with avrisp? Anyone have
a makefile that might work?
Hi Cullen,
Nice to
On Mon, 2005-10-10 at 08:50 -0500, Andy Warner wrote:
Bernard Fouché wrote:
[...]
Check that avrdude is told not to erase the eeprom before reflashing
(the default value for flash/eeprom for unset memory is 0xFF). I guess
your problem is coming from that and not single byte/block read.
ok i made it turn on. now i've attempted to make it blink,
unsuccessfully. the light just stays off now.
unsigned char i;
DDRA |= 1PA0;
while (1) {
for (i=0; i2; i++) wait();
PORTA |= 1PA0;
That's normal I think. You turn the LED on when i reaches 20,000,
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 CVS.
Now CVS seems difficult enough, so I
On Thu, 2005-09-29 at 09:25 +0200, David Brown wrote:
It's a little easier to follow than all this void (*fp[])(void) crap,
wouldn't you say?
Thanks for pointing out that my code is crap ! ;-P
I do mean it ! I mean, I am beginner... very motivated and eager to
learn the art, but I can only do
On Thu, 2005-09-29 at 14:24 +0200, David Brown wrote:
You've picked a chalenge with your complex menu structures, but you are
definitely going about it the right way. Unconstrained arrays are almost
certainly the most elegant way to deal with the structures - when you figure
them out fully,
On Thu, 2005-09-29 at 16:20 +0200, David Brown wrote:
You're getting very close now - don't give up!
David
Thanks again David for the detailed review, and thanks everyone else :-)
The forward declaration did the trick indeed, magic ! :o)
So now the definition of my menus look like this. I
I tried the '' sign, but I get this error:
ui.c:63: warning: initialization discards qualifiers from pointer target
type
I am really lost as to how to specify the address of menu_sub in
ui_menu_main
Well, once I manage to initialise the main menu with the address of the
sub menu,
If your target allow it, print pointer values when deferencing fails.
Matched with the symbol file, it will help you understand if your
problem comes from pointer calculation or not. (if you have dynamic
memory allocation, that's another story)
Bernard
Thanks for the tip Bernard !
Hi list,
Another pointer problem again, oops...
I need pointers to functions in my project. Using the great on-line
resource http://www.eskimo.com/~scs/C-faq/q4.12.html which someone on
here mentioned recently, I got the basics working.
But my actual case at hand is a bit trickier and I am lost
Thank you so much chaps, after an hour experimenting, armed with all
your suggestion, I have now improved my understanding of pointers
again... and it now works...
However, something still causes me trouble apparently
The actual/complete declaration of my menu data type / structure is :
On Wed, 2005-09-28 at 21:18 -0700, stevech wrote:
Unspecified array sizes are a basic no-no on a microprocessor platform. The
compiler strategies have to be simple and explicit, unlike elegant
situations on multi-megabyte big computers.
Thanks chaps, it's a no-no then. I will just move the
Thanks chaps, it's a no-no then. I will just move the strings out of the
structure, or make them fixed size, by setting a limit to the number of
items/options I can have in a menu.
Replying to my post but, since my struct has two arrays, one of strings
and one of pointers, and one of them MUST
Hi list,
I defined a structure in ROM, and am having difficulties accessing it
using a pointer. Structure contains an integer and an array of strings.
Accessing the array works, but when I try to read the integer number
using the pointer, I don't get the correct value what am I doing
wrong
On Fri, 2005-09-23 at 08:46 +0200, Alex Wenger wrote:
I use a small header-file and the notation b.
bin.h:
#define b 0x00
#define b0001 0x01
.
#define b 0xff
Simple, but clever :-)
Thanks for posting the entire table, that will save me the work, I will
just
Hi list,
I am very new to C, and I can't find how to specify a binary constant.
I tried for example
foo = 0b;
or
foo = b;
but neither worked...
I am using gcc-avr 3.4.3 and avr-libc 1.2.3
Regards,
--
Vince
___
GCC 3.4.3 must work for
foo = 0b;
OR
foo = 0B;
Are you getting compilation errors?
Nayani
Hi Nayani,
Yes, I get a compiler error in both cases.
About foo = 0b000; or foo = 0B; it says :
main.c:92:9: invalid suffix b on integer constant
...and
One can use binary values in AVR GCC 3.4.3.
In fact I had used the same in some of my projects
and I am not able to make a guess on why you are
getting an error.
So the patch is already in 3.4.3 ? So I should have it then !!
G :-/
MAybe the debian package is faulty in some way
On Tue, 2005-09-20 at 00:56 -0500, David Kelly wrote:
I prefer to read the busy flag in bit 7 of register 0 on the LCD
rather than timed loops. Text LCDs are fairly predictable but I'm
more comfortable delaying my next write until the particular LCD says
its ready. Some LCD commands take
On Mon, 2005-09-19 at 20:22 -0500, David Kelly wrote:
OK, 0.2ms max to write one, but how long to write two? Once the data is
latched into the LCD it has to process and IIRC that is often 1 ms.
No, as I said it takes only 40us for the LCD to process a character.
You send a character to it,
Thanks Jesper and Yann ! :-)
So far I had the clear idea that a header file should not contain any C
statement that yields to executable code, and that such code should be
in the source file. But I wasn't sure about constants, since they don't
produce any code. But, they nonetheless occupy code
Thanks chaps, printf_P and printf(%S, ) do the trick.
If I may ask one more question before, I happen to have a problem define
one of the units : °C.
This '°' degree sign is not ASCII but extended ASCII, and my LCD module
has a japanese (!) page code for extended characters.
So I need to
On Sun, 2005-09-18 at 16:54 -0500, David Kelly wrote:
...I don't use printf() so I haven't used printf_P()
But how do you do then ?
Well, now I think of it, there is at least one case where I won't be
able to use printf, well I think.
printf_P() is nice to printf my strings easily from
1 - 100 of 119 matches
Mail list logo