On 2007-08-21, David Smead <[email protected]> wrote:
>> The original put_message function that I use in my code
>> outputs characters to a serial port. I didn't post this code
>> onto the newsgroup. I stripped this function down, to do
>> something basic (incrementing the 1st value of an array) as
>> you will see in my earlier post and this causes the same
>> problem to occur,
What problem is that?
The string is going to be in flash. You can't increment a
flash location. Therefore your example code does nothing.
>> which is why I posted the stripped down code rather that the
>> output to serial port code.
If you would show us _actual_code_ that doesn't work (and
explain what it is you expect it to do), we could tell you
what's wrong with it. You've stripped the code down to the
point where it doesn't do anything, then you tell us it "has a
problem" (presumably because it doesn't do anything?).
How do you know it has a problem?
What do you expect the posted code to do?
> You don't need a global pointer. The name of an array is the
> address of the first element, so array[0] is the same element
> as *array. It's a little confusing sometimes, but extremely
> useful, and not just with basic elements like characters.
>
> For instance if you want to declare memory space for a
> structure and also use its name as a pointer, you can do this:
> struct some_type some_name[1]; You can now pass some_name as a
> pointer, or assign it to another pointer.
>> I'm just using the default compiler flags to compile my code.
>> If they were changed to something else, would my program be
>> likely to perform differently?
The problem isn't in the compiler, it's in your code.
Post code that you think is supposed to do something.
Tell us what it is it's supposed to do.
Tell us what behavior you're seeing that you think is a
problem.
--
Grant Edwards grante Yow! .. I don't understand
at the HUMOR of the THREE
visi.com STOOGES!!