<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Duplicate variable declarations in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Duplicate-variable-declarations/m-p/2406525#M59745</link>
    <description>&lt;P&gt;This is the entry in peripherals.h for both errors&lt;/P&gt;&lt;P&gt;// Lookup table for digits 0-9 (0 = ON, 1 = OFF)&lt;BR /&gt;const uint32_t CA_LUT[10] = {&lt;BR /&gt;//0: A, B, C, D, E, F are ON; G, DP are OFF&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_A)|(1&amp;lt;&amp;lt;SEG_B)|(1&amp;lt;&amp;lt;SEG_C)|(1&amp;lt;&amp;lt;SEG_D)|(1&amp;lt;&amp;lt;SEG_E)|(1&amp;lt;&amp;lt;SEG_F)),&lt;BR /&gt;// 1: B, C are ON&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_B)|(1&amp;lt;&amp;lt;SEG_C)),&lt;BR /&gt;// 2: A, B, D, E, G are ON&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_A)|(1&amp;lt;&amp;lt;SEG_B)|(1&amp;lt;&amp;lt;SEG_D)|(1&amp;lt;&amp;lt;SEG_E)|(1&amp;lt;&amp;lt;SEG_G)),&lt;BR /&gt;// 3: A, B, C, D, G are ON&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_A)|(1&amp;lt;&amp;lt;SEG_B)|(1&amp;lt;&amp;lt;SEG_C)|(1&amp;lt;&amp;lt;SEG_D)|(1&amp;lt;&amp;lt;SEG_G)),&lt;BR /&gt;// 4: B, C, F, G are ON&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_B)|(1&amp;lt;&amp;lt;SEG_C)|(1&amp;lt;&amp;lt;SEG_F)|(1&amp;lt;&amp;lt;SEG_G)),&lt;BR /&gt;// 5: A, C, D, F, G are ON&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_A)|(1&amp;lt;&amp;lt;SEG_C)|(1&amp;lt;&amp;lt;SEG_D)|(1&amp;lt;&amp;lt;SEG_F)|(1&amp;lt;&amp;lt;SEG_G)),&lt;BR /&gt;// 6: A, C, D, E, F, G are ON&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_A)|(1&amp;lt;&amp;lt;SEG_C)|(1&amp;lt;&amp;lt;SEG_D)|(1&amp;lt;&amp;lt;SEG_E)|(1&amp;lt;&amp;lt;SEG_F)|(1&amp;lt;&amp;lt;SEG_G)),&lt;BR /&gt;// 7: A, B, C are ON&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_A)|(1&amp;lt;&amp;lt;SEG_B)|(1&amp;lt;&amp;lt;SEG_C)),&lt;BR /&gt;// 8: All segments ON (A-G)&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_A)|(1&amp;lt;&amp;lt;SEG_B)|(1&amp;lt;&amp;lt;SEG_C)|(1&amp;lt;&amp;lt;SEG_D)|(1&amp;lt;&amp;lt;SEG_E)|(1&amp;lt;&amp;lt;SEG_F)|(1&amp;lt;&amp;lt;SEG_G)),&lt;BR /&gt;// 9: A, B, C, D, F, G are ON&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_A)|(1&amp;lt;&amp;lt;SEG_B)|(1&amp;lt;&amp;lt;SEG_C)|(1&amp;lt;&amp;lt;SEG_D)|(1&amp;lt;&amp;lt;SEG_F)|(1&amp;lt;&amp;lt;SEG_G))&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;// Global variables holding the current numbers to be printed on Digits 1, 2, and 3&lt;BR /&gt;volatile uint8_t display_buffer[3] = {1, 2, 3}; // E.g., displays "123"&lt;/P&gt;&lt;P&gt;Both errors are used in main.c :-&lt;/P&gt;&lt;P&gt;uint8_t numeric_value = display_buffer[current_digit];&lt;BR /&gt;uint32_t segment_pattern = CA_LUT[numeric_value];&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#include "peripherals.h" appears only in the following files: -&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;main.c, peripherals.c,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;AS I mentioned I am coming over from CodeWarrior, so my&amp;nbsp;&lt;/SPAN&gt;knowledge of MCUX is probably dangerous (?????). I'm not sure whether a 7-segment display is a peripheral device (peripherals.h and c) or a declaration for a number of pins (pin_mux.h and c), but that can be sorted out later.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Aug 2026 09:42:49 GMT</pubDate>
    <dc:creator>Julian99</dc:creator>
    <dc:date>2026-08-19T09:42:49Z</dc:date>
    <item>
      <title>Duplicate variable declarations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Duplicate-variable-declarations/m-p/2406174#M59740</link>
      <description>&lt;P&gt;I am working on a new project using the LPC824 board and the downloaded lpcxpresso824max_new_project. It built, downloaded and debugged without problems. Initially I am trying to implement a 3-digit 7-segment LED display. I added declarations in peripherals.h and an update routine in main.c. When I build I get two errors - duplicated variable declarations. If I comment them out I get a message "undeclared variable". If I change the name of the variable I get the same duplication error. I have searched every source file in the project and cannot find any duplicates. One of the error messages is: -&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/Applications/MCUXpressoIDE_25.6.136/ide/plugins/com.nxp.mcuxpresso.tools.macosx_25.6.0.202501151204/tools/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld: ./source/peripherals.o:/Users/julian/Documents/MCUXpressoIDE_25.6.136/workspace/lpcxpresso824max_new_project/Debug/../source/peripherals.h:57: multiple definition of `CA_LUT'; ./source/main.o:/Users/julian/Documents/MCUXpressoIDE_25.6.136/workspace/lpcxpresso824max_new_project/Debug/../source/peripherals.h:57: first defined here&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2026 10:39:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Duplicate-variable-declarations/m-p/2406174#M59740</guid>
      <dc:creator>Julian99</dc:creator>
      <dc:date>2026-08-18T10:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate variable declarations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Duplicate-variable-declarations/m-p/2406330#M59742</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Could you please share your peripherals.h file and peripherals.c? Or describe how did you add the declaration for CA_LUT?&lt;/P&gt;
&lt;P&gt;Could you please share how did you use CA_LUT in main.c?&lt;/P&gt;
&lt;P&gt;Kindly share all the files names in which do you have [#include "peripherals.h"], are those files headers included in main.c?&lt;/P&gt;
&lt;P&gt;Best Regards, Luis&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2026 21:35:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Duplicate-variable-declarations/m-p/2406330#M59742</guid>
      <dc:creator>luis_maravilla</dc:creator>
      <dc:date>2026-08-18T21:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate variable declarations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Duplicate-variable-declarations/m-p/2406525#M59745</link>
      <description>&lt;P&gt;This is the entry in peripherals.h for both errors&lt;/P&gt;&lt;P&gt;// Lookup table for digits 0-9 (0 = ON, 1 = OFF)&lt;BR /&gt;const uint32_t CA_LUT[10] = {&lt;BR /&gt;//0: A, B, C, D, E, F are ON; G, DP are OFF&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_A)|(1&amp;lt;&amp;lt;SEG_B)|(1&amp;lt;&amp;lt;SEG_C)|(1&amp;lt;&amp;lt;SEG_D)|(1&amp;lt;&amp;lt;SEG_E)|(1&amp;lt;&amp;lt;SEG_F)),&lt;BR /&gt;// 1: B, C are ON&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_B)|(1&amp;lt;&amp;lt;SEG_C)),&lt;BR /&gt;// 2: A, B, D, E, G are ON&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_A)|(1&amp;lt;&amp;lt;SEG_B)|(1&amp;lt;&amp;lt;SEG_D)|(1&amp;lt;&amp;lt;SEG_E)|(1&amp;lt;&amp;lt;SEG_G)),&lt;BR /&gt;// 3: A, B, C, D, G are ON&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_A)|(1&amp;lt;&amp;lt;SEG_B)|(1&amp;lt;&amp;lt;SEG_C)|(1&amp;lt;&amp;lt;SEG_D)|(1&amp;lt;&amp;lt;SEG_G)),&lt;BR /&gt;// 4: B, C, F, G are ON&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_B)|(1&amp;lt;&amp;lt;SEG_C)|(1&amp;lt;&amp;lt;SEG_F)|(1&amp;lt;&amp;lt;SEG_G)),&lt;BR /&gt;// 5: A, C, D, F, G are ON&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_A)|(1&amp;lt;&amp;lt;SEG_C)|(1&amp;lt;&amp;lt;SEG_D)|(1&amp;lt;&amp;lt;SEG_F)|(1&amp;lt;&amp;lt;SEG_G)),&lt;BR /&gt;// 6: A, C, D, E, F, G are ON&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_A)|(1&amp;lt;&amp;lt;SEG_C)|(1&amp;lt;&amp;lt;SEG_D)|(1&amp;lt;&amp;lt;SEG_E)|(1&amp;lt;&amp;lt;SEG_F)|(1&amp;lt;&amp;lt;SEG_G)),&lt;BR /&gt;// 7: A, B, C are ON&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_A)|(1&amp;lt;&amp;lt;SEG_B)|(1&amp;lt;&amp;lt;SEG_C)),&lt;BR /&gt;// 8: All segments ON (A-G)&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_A)|(1&amp;lt;&amp;lt;SEG_B)|(1&amp;lt;&amp;lt;SEG_C)|(1&amp;lt;&amp;lt;SEG_D)|(1&amp;lt;&amp;lt;SEG_E)|(1&amp;lt;&amp;lt;SEG_F)|(1&amp;lt;&amp;lt;SEG_G)),&lt;BR /&gt;// 9: A, B, C, D, F, G are ON&lt;BR /&gt;~((1&amp;lt;&amp;lt;SEG_A)|(1&amp;lt;&amp;lt;SEG_B)|(1&amp;lt;&amp;lt;SEG_C)|(1&amp;lt;&amp;lt;SEG_D)|(1&amp;lt;&amp;lt;SEG_F)|(1&amp;lt;&amp;lt;SEG_G))&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;// Global variables holding the current numbers to be printed on Digits 1, 2, and 3&lt;BR /&gt;volatile uint8_t display_buffer[3] = {1, 2, 3}; // E.g., displays "123"&lt;/P&gt;&lt;P&gt;Both errors are used in main.c :-&lt;/P&gt;&lt;P&gt;uint8_t numeric_value = display_buffer[current_digit];&lt;BR /&gt;uint32_t segment_pattern = CA_LUT[numeric_value];&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#include "peripherals.h" appears only in the following files: -&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;main.c, peripherals.c,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;AS I mentioned I am coming over from CodeWarrior, so my&amp;nbsp;&lt;/SPAN&gt;knowledge of MCUX is probably dangerous (?????). I'm not sure whether a 7-segment display is a peripheral device (peripherals.h and c) or a declaration for a number of pins (pin_mux.h and c), but that can be sorted out later.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2026 09:42:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Duplicate-variable-declarations/m-p/2406525#M59745</guid>
      <dc:creator>Julian99</dc:creator>
      <dc:date>2026-08-19T09:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate variable declarations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Duplicate-variable-declarations/m-p/2406686#M59746</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;It could be that, as you define CA_LUT in peripherals.h both the main and peripherals.c call that file giving the duplicate error "multiple definition".&lt;/P&gt;
&lt;P&gt;Could you help us try to add the declaration of CA_LUT only in peripherals.c instead of peripherals.h, and retry;&lt;/P&gt;
&lt;P&gt;Do you have more declarations as this in peripherals.h? and they have the same error? If you have them please also move them to peripherals.c&lt;/P&gt;
&lt;P&gt;Consider your 7 segments as an external peripheral device.&lt;/P&gt;
&lt;P&gt;Let me know your findings&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2026 17:02:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Duplicate-variable-declarations/m-p/2406686#M59746</guid>
      <dc:creator>luis_maravilla</dc:creator>
      <dc:date>2026-08-19T17:02:26Z</dc:date>
    </item>
  </channel>
</rss>

