avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] Corrections for *_PF functions (PR #32945)


From: S, Pitchumani
Subject: [avr-libc-dev] Corrections for *_PF functions (PR #32945)
Date: Tue, 8 Oct 2013 13:08:59 +0000

Hi,

References: PR 32945, PR 25120, PR 6352

Functions memcpy_PF/strcpy_PF incorrectly emits lpm when elpm is needed. 
Enabling elpm was based on FLASHEND macro which is not defined when building 
library for specific architecture. Replacing FLASHEND based check with 
__AVR_HAVE_ELPM__ (as suggested in PR 32945) resolves that issue.

But, finding RAMPZ register address still not addressed. Currently it is based
on RAMPZ macro in device header file. So, building library for specific arch
will result in error as AVR_RAMPZ_ADDR is not defined.

(include/avr/common.h)
284 #if defined(RAMPZ)
285 #  define AVR_RAMPZ_REG   RAMPZ
286 #  if __AVR_ARCH__ >= 100
287 #    define AVR_RAMPZ_ADDR  _SFR_MEM_ADDR(RAMPZ)
288 #  else
289 #    define AVR_RAMPZ_ADDR  _SFR_IO_ADDR(RAMPZ)
290 #  endif
291 #endif

It is possible to hard-code RAMPZ register address irrespective of device header
file (gcc also hard-codes RAMPZ address) as follows:

+#  define AVR_RAMPZ_REG   (_SFR_IO8(0x3B))
+#  define AVR_RAMPZ_ADDR  (_SFR_IO8(0x3B))

This will enable building library for a architecture than a device.

Please give your feedback.

Regards,
Pitchumani




reply via email to

[Prev in Thread] Current Thread [Next in Thread]