You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/03/07 16:10:21 UTC

[GitHub] [incubator-nuttx] patacongo commented on issue #475: up_mdelay multiple definitions

patacongo commented on issue #475: up_mdelay multiple definitions
URL: https://github.com/apache/incubator-nuttx/issues/475#issuecomment-596103686
 
 
   drivers/timer/arch_timer.c cannot be used with most configurations.
   
   If you do want to use it for some reason, you will need to manually 
   modify the architecture's Make.defs file to remove the duplicate builds 
   of up_mdelay.c and friends.
   
   There was a lot of discussion about this, but no agreement.  I argued that:
   
   1) architectures that do support up_mdelay() et al must disable 
   selection of the arch_timer driver, or
   2) A new configuration option must be added to control if the the 
   architecture should or should not build up_mdelay.c and friends.
   
   It is really a pretty bad design.  If you get motivated to clean it up, 
   feel free.  Just submit a PR.  I like option #2
   
   Greg
   
   On 3/7/2020 9:12 AM, Robin Raymond wrote:
   >
   > In file:
   > |nuttx/arch/arm/src/common/up_mdelay.c|
   >
   > |void up_mdelay(unsigned int milliseconds) { volatile unsigned int i; 
   > volatile unsigned int j; for (i = 0; i < milliseconds; i++) { for (j = 
   > 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++) { } } } |
   >
   > is defined. But if you enable the timer driver you get:
   >
   > |void up_mdelay(unsigned int milliseconds) { up_udelay(USEC_PER_MSEC * 
   > milliseconds); } |
   >
   > in file |nuttx/drivers/timers/arch_timer.c|
   >
   > And thus the compiler error becomes:
   >
   > |nuttx/nuttx/staging/libdrivers.a(arch_timer.o): In function 
   > `up_mdelay': arch_timer.c:(.text+0x208): multiple definition of 
   > `up_mdelay' 
   > nuttx/nuttx/staging/libkarch.a(up_mdelay.o):up_mdelay.c:(.text+0x0): 
   > first defined here |
   >
   > —
   > You are receiving this because you are subscribed to this thread.
   > Reply to this email directly, view it on GitHub 
   > <https://github.com/apache/incubator-nuttx/issues/475?email_source=notifications&email_token=ABFUG6SA3ZXHCJOX2A4S4LLRGJP4HA5CNFSM4LDQO7F2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4ITJUGSQ>, 
   > or unsubscribe 
   > <https://github.com/notifications/unsubscribe-auth/ABFUG6UWI775BBF7J2VGQNLRGJP4HANCNFSM4LDQO7FQ>.
   >
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services