<?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: Confused with #INCLUDE in LPCOpen. in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Confused-with-INCLUDE-in-LPCOpen/m-p/579709#M20110</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kiantek on Tue Jan 27 19:10:27 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;there are missing d_screen.h and d_screen.c in the earlier post. I used angle bracket for the filename and that was hidden.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[u]"d_screen.h"[/u]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#ifndef D_SCREEN_H_&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#define D_SCREEN_H_&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_USART_T *pUART;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void myTest(void);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#endif /* D_SCREEN_H_ */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[u]"d_screen.c"[/u]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#if defined (__USE_LPCOPEN)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#if defined(NO_BOARD_LIB)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#include "chip.h"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#include "board.h"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#endif&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#endif&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_USART_T *pUART;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void myTest(void) { LPC_USART_T myUART; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Q1:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Why [u]"d_screen.h[/u]" does not required definition of LPC_USART type? Shall I insert #include "uart_17xx_40xx.h" at header?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Q3:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For [u]"d_screen.c"[/u], is there a need to insert header #include "d_screen.h"?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry for the confusion.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 20:22:49 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T20:22:49Z</dc:date>
    <item>
      <title>Confused with #INCLUDE in LPCOpen.</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Confused-with-INCLUDE-in-LPCOpen/m-p/579708#M20109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kiantek on Tue Jan 27 02:44:06 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi, I am confused with the use of #INCLUDE in LPCOpen. I have tried numerous attempt in modifying the code and Google for the answer, but I couldn't find a concrete explanation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm developing using LPCOPEN_17XX_BOARD_EA1788. I have created a new LPCOpen project with src folder and inc folder. Error start when I tried to split the main source file into multiple functional source files.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For instance, I have created d_screen.h and d_screen.c in 'inc' folder and 'src' folder respectively.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;d_screen.h&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#ifndef D_SCREEN_H_&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#define D_SCREEN_H_&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_USART_T *pUART;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void myTest(void);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#endif /* D_SCREEN_H_ */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;d_screen.c&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#if defined (__USE_LPCOPEN)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#if defined(NO_BOARD_LIB)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#include "chip.h"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#include "board.h"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#endif&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#endif&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_USART_T *pUART;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void myTest(void) { LPC_USART_T myUART; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Above code can be compiled without any error. But I am puzzled with the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Q1:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Why &amp;lt;d_screen.h&amp;gt; does not required definition of LPC_USART type? Shall I insert #include "uart_17xx_40xx.h" at header?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Q2:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For &amp;lt;d_screen.c&amp;gt;, I failed to compiled if I change the lengthy header into #include "uart_17xx_40xx.h". Console show multiples errors as follow:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt; error: unknown type name '__IO'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt; error: expected ':', ',', ';', '}' or '__attribute__' before 'DLL'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt; error: unknown type name '__IO'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Since I'm using LPC_USART type, why can't I simply include the related header files?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Q3:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For &amp;lt;d_screen.c&amp;gt;, is there a need to insert header #include "d_screen.h"?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Q4:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can I repeatedly use the following code for all functional source files i.e. driver files?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#if defined (__USE_LPCOPEN)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#if defined(NO_BOARD_LIB)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#include "chip.h"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#include "board.h"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#endif&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#endif&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please advise me! My project files are getting very messy when I split the single main.c into different source file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope experienced programmer could share your coding convention for similar situation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sincerely,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;KT&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:22:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Confused-with-INCLUDE-in-LPCOpen/m-p/579708#M20109</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Confused with #INCLUDE in LPCOpen.</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Confused-with-INCLUDE-in-LPCOpen/m-p/579709#M20110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kiantek on Tue Jan 27 19:10:27 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;there are missing d_screen.h and d_screen.c in the earlier post. I used angle bracket for the filename and that was hidden.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[u]"d_screen.h"[/u]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#ifndef D_SCREEN_H_&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#define D_SCREEN_H_&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_USART_T *pUART;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void myTest(void);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#endif /* D_SCREEN_H_ */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[u]"d_screen.c"[/u]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#if defined (__USE_LPCOPEN)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#if defined(NO_BOARD_LIB)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#include "chip.h"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#include "board.h"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#endif&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#endif&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_USART_T *pUART;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void myTest(void) { LPC_USART_T myUART; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Q1:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Why [u]"d_screen.h[/u]" does not required definition of LPC_USART type? Shall I insert #include "uart_17xx_40xx.h" at header?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Q3:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For [u]"d_screen.c"[/u], is there a need to insert header #include "d_screen.h"?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry for the confusion.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:22:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Confused-with-INCLUDE-in-LPCOpen/m-p/579709#M20110</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:22:49Z</dc:date>
    </item>
  </channel>
</rss>

