<?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>Kinetis MicrocontrollersのトピックRe: PEG Get Timer Event event if timer killed</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PEG-Get-Timer-Event-event-if-timer-killed/m-p/1022112#M56282</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm allow me to place here the answer from PEG support:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;I'm a engineer of PEG team. Glad to assist you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;Here is the code of Destroy function:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: #c82613;"&gt;Presentation()-&amp;gt;ThingDestroyed(pWhat);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: #c82613;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TimerManager()-&amp;gt;KillTimer(pWhat, 0, TRUE);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: #c82613;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageQueue()-&amp;gt;Purge(pWhat); &amp;nbsp; &amp;nbsp;// no more messages for this guy!&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: #c82613;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; delete pWhat;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: #c82613;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pWhat = NULL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;As you can see here, Destroy function iftself will delete the timer, purge all related messages in MessageQueue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;So you needn't to call KillTimer after Destroy function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;You are handling two asynchromous events (Button click and Timer). Both of them are able to destroy the current windows. So, to ensure the code run correctly, please add a FLAG (ex. FLAG_ON_DESTROYING) to monitor the status of the window. Because although you call to Destroy function, the object will not be destroyed immediately. We only add new rootwindow and destroy current window in case of FLAG_ON_DESTROYING = false.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;Hope that helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;...&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;Finally, I could reproduce your situation on my side by adding a Timer event directly before calling Destroy function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;Add I said, when you call Destroy function, the Object can be either deleted immediately or push to garbage collector depend on the running context. That means destroy steps (include killing timer and purging messages) can be implemented immediately or later. In the case of the second condition, a Timer event can be add to Queue before the garbage collector really delete the object. That why Timer handler still be called after Destroy method.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;I agree that this may be a issue of the garbage collector. We will find the way to improve its mechanism.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;The code shoud like as below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;In the window construction:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;FLAG_ON_DESTROYING = false;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;In Message handler:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; "&gt;case&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp;&lt;STRONG&gt;PEG_SIGNAL&lt;/STRONG&gt;(ID_ReturnButton, PSF_CLICKED)&lt;/SPAN&gt;&lt;STRONG style="color: blue; background: white; font-size: 10.0pt; "&gt;:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; background: white; font-size: 10.0pt; "&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(FLAG_ON_DESTROYNG == false)&lt;BR /&gt; &lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: teal; background: white;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: teal; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style="color: blue; background: white; font-size: 10.0pt; "&gt;FLAG_ON_DESTROYNG = true;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; background: white; font-size: 10.0pt; "&gt;&lt;BR /&gt; &lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PegWindow *pw&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style="color: blue; background: white; font-size: 10.0pt; "&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; "&gt;new&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp;&lt;STRONG&gt;rootwindow&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: olive; background: white;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: olive; background: white;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;Parent&lt;/STRONG&gt;()&lt;/SPAN&gt;&lt;STRONG style="color: blue; background: white; font-size: 10.0pt; "&gt;-&amp;gt;&lt;/STRONG&gt;&lt;STRONG style="color: black; background: white; font-size: 10.0pt; "&gt;Add&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;(pw);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;Destroy&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; "&gt;this&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: teal; background: white;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;ID_ReturnButton;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;case PM_TIMER:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style="color: blue; background: white; font-size: 10.0pt; "&gt;if(FLAG_ON_DESTROYNG == false)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style="color: blue; background: white; font-size: 10.0pt; "&gt;FLAG_ON_DESTROYNG = true;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PegWindow *pw = new rootwindow(0, 0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Parent()-&amp;gt;Add(pw);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Destroy(this);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Feb 2020 06:47:33 GMT</pubDate>
    <dc:creator>arnogir</dc:creator>
    <dc:date>2020-02-25T06:47:33Z</dc:date>
    <item>
      <title>PEG Get Timer Event event if timer killed</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PEG-Get-Timer-Event-event-if-timer-killed/m-p/1022111#M56281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;I start the project with peg 5 years ago, And at this time, there was a support via email.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;Today, this email is broken!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;So I ask the question here.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;I’m facing a problem with the PEG which lead to a µC crash.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;I’m on a Kinetis K70 with MQX 4.2, PEG lite 2.4.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;I’m on a screen in which I start a timer when I press a PegButton:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 12.0pt;"&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; "&gt;case&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt; &lt;STRONG&gt;PEG_SIGNAL&lt;/STRONG&gt;(ID_AP_SCREEN_Cleaning_ConfirmButton, PSF_CLICKED)&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; "&gt;:&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; "&gt;// WB_AUTO_GEN&amp;nbsp; Enter your code here:&lt;BR /&gt; &lt;/EM&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; "&gt;….&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;SetTimer&lt;/STRONG&gt;(AP_SCREEN_CLEANING_TIMER_ANIMATION, PEG_ONE_SECOND&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; "&gt;/&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: olive;"&gt;10&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;, PEG_ONE_SECOND&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; "&gt;/&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: olive;"&gt;10&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: teal;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;On another button, I select in the PegBuilder it should make a “switch to” the RootWindow, then the generated code is following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 12.0pt;"&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; "&gt;case&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt; &lt;STRONG&gt;PEG_SIGNAL&lt;/STRONG&gt;(ID_AP_SCREEN_Cleaning_CancelButton, PSF_CLICKED)&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; "&gt;:&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: teal;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PegWindow *pw &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; "&gt;=&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10.0pt; "&gt;new&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt; &lt;STRONG&gt;rootwindow&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: olive;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: olive;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Parent&lt;/STRONG&gt;()&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; "&gt;-&amp;gt;&lt;/STRONG&gt;&lt;STRONG style="color: black; font-size: 10.0pt; "&gt;Add&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;(pw);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: teal;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Destroy&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; "&gt;this&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; "&gt;// WB_AUTO_GEN Enter your code here:&lt;BR /&gt; &lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;KillTimer&lt;/STRONG&gt;(AP_SCREEN_CLEANING_TIMER_ANIMATION);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; "&gt;return&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt; ID_AP_SCREEN_Cleaning_CancelButton;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;EM style="color: green; font-size: 10.0pt; "&gt;/* WB_AUTO_GEN End case */&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;You can see the generated code, switch to the RootWindow, and destroy the current view.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;After that, I kill the created timer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;But, in some case, I think the Timer event was already into the queue when the timer is killed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;Then, I get later event timer, in which for some reason, I do the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; "&gt;case&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt; PM_TIMER&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; "&gt;:&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: teal;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; "&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt; (Mesg&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; "&gt;.&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;Param &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; "&gt;==&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt; AP_SCREEN_CLEANING_TIMER_ANIMATION)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: teal;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;….&lt;/STRONG&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; "&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt; (&lt;STRONG&gt;AP_Clean_GetState&lt;/STRONG&gt;() &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; "&gt;==&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt; AP_CLEAN_IDLE)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: teal;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;….&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 12.0pt;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PegWindow *pw &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; "&gt;=&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10.0pt; "&gt;new&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt; &lt;STRONG&gt;rootwindow&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: olive;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: olive;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Parent&lt;/STRONG&gt;()&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; "&gt;-&amp;gt;&lt;/STRONG&gt;&lt;STRONG style="color: black; font-size: 10.0pt; "&gt;Add&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;(pw);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Destroy&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; "&gt;this&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;KillTimer&lt;/STRONG&gt;(AP_SCREEN_CLEANING_TIMER_ANIMATION);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: teal;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;CheckDefault&lt;/STRONG&gt;();&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: teal;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt; &lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; "&gt;return&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt; PegWindow&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; "&gt;::&lt;/STRONG&gt;&lt;STRONG style="color: black; font-size: 10.0pt; "&gt;Message&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;(Mesg);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;In fact, it is a supervision timer which check a state of my application. If state is Idle, I should quit the current view and return to the root window.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;Then, Like the event timer was into the queue before I press the cancel button, I also get the timer event in which I also create the rootwindow and destry(this)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 12.0pt;"&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;So this part is done twice time! Then I obtain a µC crash on the &lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10.0pt; "&gt;Parent&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;()&lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 10.0pt; "&gt;-&amp;gt;&lt;/STRONG&gt;&lt;STRONG style="color: black; font-size: 10.0pt; "&gt;Add&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;(pw);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;Could you advise me if there are a simple way to discard all the selected timer event into the queue when I Kill them?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 07:54:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PEG-Get-Timer-Event-event-if-timer-killed/m-p/1022111#M56281</guid>
      <dc:creator>arnogir</dc:creator>
      <dc:date>2020-01-30T07:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: PEG Get Timer Event event if timer killed</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PEG-Get-Timer-Event-event-if-timer-killed/m-p/1022112#M56282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm allow me to place here the answer from PEG support:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;I'm a engineer of PEG team. Glad to assist you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;Here is the code of Destroy function:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: #c82613;"&gt;Presentation()-&amp;gt;ThingDestroyed(pWhat);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: #c82613;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TimerManager()-&amp;gt;KillTimer(pWhat, 0, TRUE);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: #c82613;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageQueue()-&amp;gt;Purge(pWhat); &amp;nbsp; &amp;nbsp;// no more messages for this guy!&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: #c82613;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; delete pWhat;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: #c82613;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pWhat = NULL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;As you can see here, Destroy function iftself will delete the timer, purge all related messages in MessageQueue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;So you needn't to call KillTimer after Destroy function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;You are handling two asynchromous events (Button click and Timer). Both of them are able to destroy the current windows. So, to ensure the code run correctly, please add a FLAG (ex. FLAG_ON_DESTROYING) to monitor the status of the window. Because although you call to Destroy function, the object will not be destroyed immediately. We only add new rootwindow and destroy current window in case of FLAG_ON_DESTROYING = false.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;Hope that helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;...&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;Finally, I could reproduce your situation on my side by adding a Timer event directly before calling Destroy function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;Add I said, when you call Destroy function, the Object can be either deleted immediately or push to garbage collector depend on the running context. That means destroy steps (include killing timer and purging messages) can be implemented immediately or later. In the case of the second condition, a Timer event can be add to Queue before the garbage collector really delete the object. That why Timer handler still be called after Destroy method.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN style="font-family: 'Calibri',sans-serif; color: black;"&gt;I agree that this may be a issue of the garbage collector. We will find the way to improve its mechanism.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;The code shoud like as below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;In the window construction:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;FLAG_ON_DESTROYING = false;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;In Message handler:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; "&gt;case&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp;&lt;STRONG&gt;PEG_SIGNAL&lt;/STRONG&gt;(ID_ReturnButton, PSF_CLICKED)&lt;/SPAN&gt;&lt;STRONG style="color: blue; background: white; font-size: 10.0pt; "&gt;:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; background: white; font-size: 10.0pt; "&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(FLAG_ON_DESTROYNG == false)&lt;BR /&gt; &lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: teal; background: white;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: teal; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style="color: blue; background: white; font-size: 10.0pt; "&gt;FLAG_ON_DESTROYNG = true;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; background: white; font-size: 10.0pt; "&gt;&lt;BR /&gt; &lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PegWindow *pw&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style="color: blue; background: white; font-size: 10.0pt; "&gt;=&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; "&gt;new&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp;&lt;STRONG&gt;rootwindow&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: olive; background: white;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: olive; background: white;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;Parent&lt;/STRONG&gt;()&lt;/SPAN&gt;&lt;STRONG style="color: blue; background: white; font-size: 10.0pt; "&gt;-&amp;gt;&lt;/STRONG&gt;&lt;STRONG style="color: black; background: white; font-size: 10.0pt; "&gt;Add&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;(pw);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;Destroy&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; "&gt;this&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: teal; background: white;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;ID_ReturnButton;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;case PM_TIMER:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style="color: blue; background: white; font-size: 10.0pt; "&gt;if(FLAG_ON_DESTROYNG == false)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style="color: blue; background: white; font-size: 10.0pt; "&gt;FLAG_ON_DESTROYNG = true;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PegWindow *pw = new rootwindow(0, 0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Parent()-&amp;gt;Add(pw);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Destroy(this);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black; background: white;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2020 06:47:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PEG-Get-Timer-Event-event-if-timer-killed/m-p/1022112#M56282</guid>
      <dc:creator>arnogir</dc:creator>
      <dc:date>2020-02-25T06:47:33Z</dc:date>
    </item>
  </channel>
</rss>

