I?m not a Arduino developer but from my research that PROGMEM on
parameters probably doesn?t do anything.


Everything thing I?ve read is that it only effects the declarations (I.e.
The memory location where its allocated)
With a function parameter its just a pointer being passed around.

On 1/16/15, 7:43 PM, "Thiago Macieira" <thiago.macieira at intel.com> wrote:

>On Friday 16 January 2015 16:40:01 Agrawal, Sachin wrote:
>> >#ifndef ARDUINO
>> >void OICLogBuffer(LogLevel level, const char * tag, const uint8_t *
>>buffer,
>> >uint16_t bufferSize); #else void OICLogBuffer(LogLevel level, PROGMEM
>> >const char * tag, const uint8_t * buffer, uint16_t bufferSize); #endif
>> >
>> >The use of a macro seems to point to a coding practice of just
>>#define'ing
>> >it to empty on other systems. Do other projects do that? Is that
>> >recommended?
>> >
>> >--
>> >Thiago Macieira - thiago.macieira (AT) intel.com
>> >  Software Architect - Intel Open Source Technology Center
>> 
>> Hi Thiago,
>> 
>> On Arduino, if we do not classify the 'logging string' as PROGMEM, it
>>will
>> sit in the .data segment and will occupy space in SRAM. On ArduinoMega
>> 2560, this becomes a problem as we have ONLY 8Kb of SRAM to play with
>>and
>> our stack (when debug mode enabled) cannot run successfully without
>>forcing
>> all the strings to Flash memory.
>
>Hi Sachin
>
>Thanks, I think I understand now what the macro is for.
>
>But I was asking for a best practice in writing code that works on both
>Arduino and in other platforms, avoiding #ifdef heavy solutions. Adding a
>#define PROGMEM somewhere in our headers seem like a simple solution for
>this 
>particular case, for example. Are there any other suggestions from people
>who 
>have done Arduino development more extensively?
>
>-- 
>Thiago Macieira - thiago.macieira (AT) intel.com
>  Software Architect - Intel Open Source Technology Center
>
>_______________________________________________
>iotivity-dev mailing list
>iotivity-dev at lists.iotivity.org
>https://lists.iotivity.org/mailman/listinfo/iotivity-dev

Reply via email to