<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>expected expression before &amp;#39;{&amp;#39; token when using WDT</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/109729/expected-expression-before-token-when-using-wdt</link><description>this is causing expected expression before &amp;#39;{&amp;#39; token 
 
 /** @brief WDT driver default configuration. */ #define NRFX_WDT_DEAFULT_CONFIG \ { \ .behaviour = (nrf_wdt_behaviour_t)NRFX_WDT_CONFIG_BEHAVIOUR, \ .reload_value = NRFX_WDT_CONFIG_RELOAD_VALUE</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 04 Apr 2024 07:41:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/109729/expected-expression-before-token-when-using-wdt" /><item><title>RE: expected expression before '{' token when using WDT</title><link>https://devzone.nordicsemi.com/thread/477019?ContentTypeID=1</link><pubDate>Thu, 04 Apr 2024 07:41:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37428a3f-88bf-4dbd-a6cc-6c2831dfeb62</guid><dc:creator>sleeper</dc:creator><description>&lt;p&gt;So ive changed to non legacy driver i.e. nrfx_ calls and still had the same issue.&lt;/p&gt;
&lt;p&gt;I believe this is a compiler issue, to do with initializing&amp;nbsp;&amp;nbsp;config = NRFX_WDT_DEAFULT_CONFIG;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So ive changed to this and it now works&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;static const nrfx_wdt_config_t wdt_config =&lt;br /&gt;{&lt;br /&gt; .behaviour = NRFX_WDT_CONFIG_BEHAVIOUR,&lt;br /&gt; .reload_value = NRFX_WDT_CONFIG_RELOAD_VALUE,&lt;br /&gt; .interrupt_priority = NRFX_WDT_CONFIG_IRQ_PRIORITY&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;/**&lt;br /&gt; * @brief WDG function to initialise.&lt;br /&gt; */&lt;br /&gt;void wdg_init(void)&lt;br /&gt;{&lt;br /&gt;uint32_t err_code;&lt;br /&gt;nrfx_wdt_config_t config = wdt_config;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt; NRF_LOG_INFO(&amp;quot;Watchdog init...&amp;quot;);&lt;/p&gt;
&lt;p&gt;err_code = nrfx_wdt_init(&amp;amp;config, &lt;br /&gt; wdg_event_handler);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;err_code = nrfx_wdt_channel_alloc(&amp;amp;channel_id);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;NRF_LOG_INFO(&amp;quot;Watchdog enabled %d&amp;quot;,channel_id);&lt;br /&gt; nrfx_wdt_enable();&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: expected expression before '{' token when using WDT</title><link>https://devzone.nordicsemi.com/thread/476899?ContentTypeID=1</link><pubDate>Wed, 03 Apr 2024 13:11:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c27886db-0390-4289-aa89-1cee0d370957</guid><dc:creator>sleeper</dc:creator><description>&lt;p&gt;/**&lt;br /&gt; * @brief WDG function to initialise.&lt;br /&gt; */&lt;br /&gt;void wdg_init(void)&lt;br /&gt;{&lt;br /&gt;uint32_t err_code;&lt;br /&gt;//nrfx_wdt_config_t config = wdt_config;&lt;br /&gt;nrf_drv_wdt_config_t config;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; NRF_LOG_INFO(&amp;quot;Watchdog init...&amp;quot;);&lt;/p&gt;
&lt;p&gt;config = NRF_DRV_WDT_DEAFULT_CONFIG;&lt;/p&gt;
&lt;p&gt;err_code = nrf_drv_wdt_init(&amp;amp;config, &lt;br /&gt; wdg_event_handler);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;err_code = nrf_drv_wdt_channel_alloc(&amp;amp;channel_id);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; &lt;br /&gt; NRF_LOG_INFO(&amp;quot;Watchdog enabled %d&amp;quot;, channel_id);&lt;br /&gt; nrf_drv_wdt_enable();&lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: expected expression before '{' token when using WDT</title><link>https://devzone.nordicsemi.com/thread/476871?ContentTypeID=1</link><pubDate>Wed, 03 Apr 2024 12:19:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf3732c3-edd6-40a1-a24b-f52879a4fbf6</guid><dc:creator>sleeper</dc:creator><description>&lt;p&gt;If i try the example it builds ok, but, i&amp;#39;m trying to add this to my existing project.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So this could be a project setup issue, but i&amp;#39;m not sure.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do you need both WDT_ENABLE and NRFX_WDT_ENABLE ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: expected expression before '{' token when using WDT</title><link>https://devzone.nordicsemi.com/thread/476869?ContentTypeID=1</link><pubDate>Wed, 03 Apr 2024 12:14:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9c44413-0a1b-4dd3-9663-9d2f2c65383f</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Sorry for the late reply. We have some backlog after the Easter Holidays here in Norway.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;C is a bit tricky this way, but I believe the error is above what you pasted here. Possibly a missing &amp;quot;;&amp;quot; or something.&lt;/p&gt;
&lt;p&gt;Try to download a new copy of the SDK, unzip it, and see if the SDK\modules\nrfx\drivers\include\nrfx_wdt.h file is identical to the one that you are using now.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>