<?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>Compiler optimization OFF for certain snippet of code in Visual code studio</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/101904/compiler-optimization-off-for-certain-snippet-of-code-in-visual-code-studio</link><description>Hi Team, 
 I know to change the compiler optimization of the project in menu config--&amp;gt; compiler settings. 
 
 
 Do we have any macro/configuration/option to enable/disable optimization for certain lines of code maintaing over all optimization settings</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 19 Jul 2023 06:03:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/101904/compiler-optimization-off-for-certain-snippet-of-code-in-visual-code-studio" /><item><title>RE: Compiler optimization OFF for certain snippet of code in Visual code studio</title><link>https://devzone.nordicsemi.com/thread/437122?ContentTypeID=1</link><pubDate>Wed, 19 Jul 2023 06:03:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d36b5f8a-ed20-4e74-8f4b-7717c9a5b054</guid><dc:creator>Priyanka</dc:creator><description>&lt;p&gt;Yes, please do try and let me know how it goes. &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;-Priyanka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler optimization OFF for certain snippet of code in Visual code studio</title><link>https://devzone.nordicsemi.com/thread/437077?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2023 15:24:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edd1805b-1663-4502-a713-0442b301603c</guid><dc:creator>praveenpalaparthi</dc:creator><description>&lt;p&gt;Priyanka,&lt;/p&gt;
&lt;p&gt;We are using signal mechanisim in UART interrupt call back function. When we get signal from UART call back,&amp;nbsp; application will try to read data from ring buffer. As the data recevies continiously from UART with a delay maximum of 10msec, we implemented this logic, first iteration of do-while loop, reads data from ring buffer waits for 10msec and check for ringbuffer emply(head &amp;amp; tail are at same position) if ring buffer is empy comes out of this loop other wise reads the ring buffer again. During this process ringbuffer gives the number of bytes it read. With visual code studio its coming out of do while loop which means got number of bytes it read but printing as 0.&lt;/p&gt;
&lt;p&gt;Will try with volatile keyword and see the behaviour.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler optimization OFF for certain snippet of code in Visual code studio</title><link>https://devzone.nordicsemi.com/thread/436881?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2023 06:15:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:429bb477-1c6e-4056-8295-03ffb9297395</guid><dc:creator>Priyanka</dc:creator><description>&lt;p&gt;Hi Praveen,&lt;/p&gt;
&lt;p&gt;I have heard back from the experts and they mention that you are looking for the keyword volatile. Could you also&amp;nbsp;check if&amp;nbsp;you could signal data being ready instead of busy looping?&lt;/p&gt;
&lt;p&gt;-Priyanka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler optimization OFF for certain snippet of code in Visual code studio</title><link>https://devzone.nordicsemi.com/thread/436879?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2023 06:03:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0c902e1-5e03-4c6d-9252-9ca010279337</guid><dc:creator>Priyanka</dc:creator><description>&lt;p&gt;Hi Praveen,&lt;/p&gt;
&lt;p&gt;I have inquired internally regarding this and will get back to you as soon as I get a response. Please expect a delay as we are currently short staffed owing to the summer holidays here in Norway.&lt;/p&gt;
&lt;p&gt;Thank you for your patience and understanding.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Priyanka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler optimization OFF for certain snippet of code in Visual code studio</title><link>https://devzone.nordicsemi.com/thread/436832?ContentTypeID=1</link><pubDate>Mon, 17 Jul 2023 16:40:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55c7af0f-816c-47f9-a508-9842a8858997</guid><dc:creator>praveenpalaparthi</dc:creator><description>&lt;p&gt;Hi Priyanka,&lt;/p&gt;
&lt;p&gt;The code snippet highlighted is not working as expected in visual code studio but the same is working fine in Segger Embedded Studio (SeS). The visual code studio is optimising these highlighted lines and coming out of the loop and printing the value of evcSerialDataHandler.receivelength as zero.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1689612019245v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;with regards,&lt;/p&gt;
&lt;p&gt;Praveen Palaparthi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler optimization OFF for certain snippet of code in Visual code studio</title><link>https://devzone.nordicsemi.com/thread/436760?ContentTypeID=1</link><pubDate>Mon, 17 Jul 2023 13:07:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdf7fa72-4248-4eb6-b368-05070d2e11eb</guid><dc:creator>Priyanka</dc:creator><description>&lt;p&gt;HI Praveen,&lt;/p&gt;
&lt;p&gt;I am not sure I understand completely, but please take a look at &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/config_and_build/modifying.html#id12"&gt;Modifying an application&lt;/a&gt;. Maybe this helps?&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Priyanka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>