<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: Just curious ... Millis();</title>
		<link>http://forums.leaflabs.com/topic.php?id=155</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:19:34 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=155" rel="self" type="application/rss+xml" />

		<item>
			<title>bnewbold on "Just curious ... Millis();"</title>
			<link>http://forums.leaflabs.com/topic.php?id=155#post-1016</link>
			<pubDate>Sun, 05 Sep 2010 18:21:58 +0000</pubDate>
			<dc:creator>bnewbold</dc:creator>
			<guid isPermaLink="false">1016@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Strange indeed! &#60;/p&#62;
&#60;p&#62;gbulmer, if you're looking at the 'master' branch of libmaple, the SysTick system has been improved and rewritten, so this may be a problem specific to the v0.0.6 release. To paraphrase the commit log: &#34;Fixed millis(), it was just wrong, before.&#34;&#60;/p&#62;
&#60;p&#62;andy, hopefully your problem will be gone in the 0.0.7 release.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Just curious ... Millis();"</title>
			<link>http://forums.leaflabs.com/topic.php?id=155#post-1000</link>
			<pubDate>Sat, 04 Sep 2010 13:24:39 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">1000@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Andy, I really have no idea what is causing that behaviour.&#60;br /&#62;
As far as I can see there are only two lines of code in the whole library which change the underlying millis() variable, systick_timer_millis. It is changed in systick.c.&#60;/p&#62;
&#60;p&#62;One is systick_timer_millis = 0;&#60;br /&#62;
the other is systick_timer_millis++;&#60;/p&#62;
&#60;p&#62;The only way that I can see to get the systick_timer_millis = 0;&#60;br /&#62;
is to start the program from scratch because the variable is initialised to 0, and not assigned 0 in any ordinary function.&#60;/p&#62;
&#60;p&#62;Otherwise, it seems likely that something might be scribbling into systick_timer_millis.&#60;br /&#62;
Can you copy systick.c, and compile it as part of your sketch. This might move systick_timer_millis in memory, so that the bug moves (might not of course).&#60;br /&#62;
You could also modify a copy, and put some padding around systick_timer_millis to see if things change.&#60;/p&#62;
&#60;p&#62;That's my best idea.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>leaflabsandy on "Just curious ... Millis();"</title>
			<link>http://forums.leaflabs.com/topic.php?id=155#post-997</link>
			<pubDate>Sat, 04 Sep 2010 11:12:52 +0000</pubDate>
			<dc:creator>leaflabsandy</dc:creator>
			<guid isPermaLink="false">997@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;It seems when I shutdown serial2 millis seems to work.&#60;br /&#62;
Interrupts or something is blocking millis when using serial port #2.&#60;br /&#62;
Maybe the serial ports have a higher priority than the systic?&#60;br /&#62;
Further testing on going ...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Just curious ... Millis();"</title>
			<link>http://forums.leaflabs.com/topic.php?id=155#post-994</link>
			<pubDate>Sat, 04 Sep 2010 08:47:06 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">994@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hmmm, interesting bug, ... good luck :-)&#60;/p&#62;
&#60;p&#62;Is it provoked by using *only* comport 2, or does it need some activity on comport 1 while comport 2 is active?&#60;/p&#62;
&#60;p&#62;(I was EST, in MA, but now back to BST, and this month Zulu, my favourite !-)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>leaflabsandy on "Just curious ... Millis();"</title>
			<link>http://forums.leaflabs.com/topic.php?id=155#post-993</link>
			<pubDate>Sat, 04 Sep 2010 08:44:56 +0000</pubDate>
			<dc:creator>leaflabsandy</dc:creator>
			<guid isPermaLink="false">993@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Here goes ...&#60;/p&#62;
&#60;p&#62;-------------------------------------------------------------------------------------&#60;br /&#62;
Platform: Windows XP SP3&#60;br /&#62;
Device:   Maple (red) rev 3&#60;br /&#62;
IDE:      0.0.6&#60;/p&#62;
&#60;p&#62;External Hardware: 4D Systems &#34;down under&#34; uLCD-32PT(SGC) Serial QVGA LCD Touch Screen with SD.&#60;/p&#62;
&#60;p&#62;Comports used: Serial1: For diagnostics from QVGA touch screen&#60;br /&#62;
               Serial2: Serial TTL connection to uLCD-32PT LCD Touch QVGA&#60;/p&#62;
&#60;p&#62;--------------------------------------------------------------------------------------&#60;/p&#62;
&#60;p&#62;Code description/operation:&#60;/p&#62;
&#60;p&#62;In the main loop I have a Millis 5 min. LCD screen saver to prevent &#34;burn out&#34;.&#60;br /&#62;
I also have a 1 sec millis(); to poll the touch screen. The function&#60;br /&#62;
&#34;ouled.get_Touch_Coord(0x00); will send back to comport Serial1 the coordinates of the touch.&#60;br /&#62;
The touch coordinates (4 bytes)  then gets printed to Serial2 for diagnostics. The moment,&#60;br /&#62;
I press the touch screen, with a non zero coordinates, the serial transmission begins which&#60;br /&#62;
resets the &#34;screen saver millis&#34; to zero for no reason. Without any comm activity on Serial2&#60;br /&#62;
from the touch screen, the &#34;screen saver millis&#34; works fine.&#60;/p&#62;
&#60;p&#62;The general operation is this. I am sending a setup command serially to comport #1 to the&#60;br /&#62;
touch screen. The touch responds with a 4 byte touch coordinate and transmits back&#60;br /&#62;
on comport #1. The Maple redirects the touch coordinates to diagnostic comport #2.&#60;br /&#62;
The serial flow activity from comport #2 resets the millis timer to zero and restarts.&#60;br /&#62;
The millis timer should never reset except for once every 67 days? &#60;/p&#62;
&#60;p&#62;--------------------------------------------------------------------------------------&#60;/p&#62;
&#60;p&#62;----------&#60;br /&#62;
Beta Code:&#60;br /&#62;
---------- &#60;/p&#62;
&#60;p&#62;/*&#60;br /&#62;
Description: uLCD-32PT QVGA Touch Test Code&#60;br /&#62;
Author: Hacker&#60;br /&#62;
Date:   9/3/10&#60;br /&#62;
Time:    xxxx&#60;br /&#62;
Platform: Win XP SP3&#60;br /&#62;
Device:   Maple red rev. 3&#60;br /&#62;
IDE: 0.0.6&#60;br /&#62;
*/&#60;/p&#62;
&#60;p&#62;/* color is a 16 bit value.&#60;br /&#62;
 binary representation       1111111111111111        (this will give white) same as 0xffff in hexadecimal or 65535 decimal&#60;br /&#62;
 //                                     &#124;&#124;&#124;&#124;&#124;-&#38;gt; value for blue&#60;br /&#62;
 //                               &#124;&#124;&#124;&#124;&#124;&#124;-&#38;gt; value for green&#60;br /&#62;
 //                          &#124;&#124;&#124;&#124;&#124;-&#38;gt; value for red&#60;br /&#62;
 */&#60;br /&#62;
//------------------------------------------------------------------------------------------------------------&#60;br /&#62;
#include &#38;lt;uOLED.h&#38;gt;&#60;br /&#62;
#include &#38;lt;colors.h&#38;gt;&#60;/p&#62;
&#60;p&#62;#define COMM Serial2&#60;br /&#62;
#define DIAG Serial1&#60;br /&#62;
#define BLUE_LED_PIN 13 &#60;/p&#62;
&#60;p&#62;uOLED uoled;                    // &#38;lt;------&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt; Create an instance of the uOLED class&#60;/p&#62;
&#60;p&#62;byte i,j;                       // some variables for looping&#60;br /&#62;
int color=0;                    // a variable named color with an initial value of 0 (black)&#60;br /&#62;
char result = 0;&#60;/p&#62;
&#60;p&#62;int toggle = 0;&#60;/p&#62;
&#60;p&#62;int interval_T_Scan = 1000;                  //touch scan processing time&#60;br /&#62;
unsigned long startTime_T_Scan;&#60;/p&#62;
&#60;p&#62;long interval_Screen_Saver = 300000;         // 300 secs screen save - shut display down / off&#60;br /&#62;
unsigned long startTime_Screen_Saver;&#60;/p&#62;
&#60;p&#62;void check_Res(void){&#60;br /&#62;
  result = uoled.res;&#60;br /&#62;
  if (result == 0x06){&#60;br /&#62;
    DIAG.println(&#34;ACK - Good&#34;);&#60;br /&#62;
  }&#60;br /&#62;
  if (result == 0x30){&#60;br /&#62;
    DIAG.println(&#34;NAK - Bad!&#34;);&#60;br /&#62;
  } // zero '0' is used for NAK&#60;br /&#62;
}  &#60;/p&#62;
&#60;p&#62;void draw_uLCD_Display(void)&#60;br /&#62;
{&#60;br /&#62;
  // draw display screen&#60;br /&#62;
  uoled.Rectangle(0,0,239,319,WHITE,FULL);                           // draw a rectangle with color white&#60;br /&#62;
  uoled.Line (1, 40, 239, 40, WHITE);                                // draw a line with color white&#60;br /&#62;
  uoled.Line (1, 233, 239, 233, WHITE);                              // draw a line with color white&#60;/p&#62;
&#60;p&#62;  uoled.TextButton(1,25,50,BLUE,SMALL_FONT,WHITE,1,2,&#34;Option 1&#34;);&#60;br /&#62;
  uoled.TextButton(1,25,80,BLUE,SMALL_FONT,WHITE,1,2,&#34;Option 2&#34;);&#60;br /&#62;
  uoled.TextButton(1,25,110,BLUE,SMALL_FONT,WHITE,1,2,&#34;Option 3&#34;);&#60;br /&#62;
  uoled.TextButton(1,25,140,BLUE,SMALL_FONT,WHITE,1,2,&#34;Option 4&#34;);&#60;br /&#62;
  uoled.TextButton(1,25,170,BLUE,SMALL_FONT,WHITE,1,2,&#34;Option 5&#34;);&#60;br /&#62;
  uoled.TextButton(1,25,200,BLUE,SMALL_FONT,WHITE,1,2,&#34;Option 6&#34;);&#60;/p&#62;
&#60;p&#62;  uoled.TextButton(1,150,50,BLUE,SMALL_FONT,WHITE,1,2,&#34;Option 7&#34;);&#60;br /&#62;
  uoled.TextButton(1,150,80,BLUE,SMALL_FONT,WHITE,1,2,&#34;Option 8&#34;);&#60;br /&#62;
  uoled.TextButton(1,150,110,BLUE,SMALL_FONT,WHITE,1,2,&#34;Option 9&#34;);&#60;br /&#62;
  uoled.TextButton(1,150,140,BLUE,SMALL_FONT,WHITE,1,2,&#34;Option 10&#34;);&#60;br /&#62;
  uoled.TextButton(1,150,170,BLUE,SMALL_FONT,WHITE,1,2,&#34;Option 11&#34;);&#60;br /&#62;
  uoled.TextButton(1,150,200,BLUE,SMALL_FONT,WHITE,1,2,&#34;Option 12&#34;);&#60;br /&#62;
} &#60;/p&#62;
&#60;p&#62;void turn_Display_On(void){&#60;br /&#62;
  uoled.SetPowerState(1);           // display powerup&#60;br /&#62;
  uoled.SetContrast(5);             // set the contrast of the display to 5 (0 to 15 default (not always) is 8)&#60;br /&#62;
  draw_uLCD_Display();              // redraw screen&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;void setup()&#60;br /&#62;
{&#60;br /&#62;
  COMM.begin(9600);                 // Default comport for uLCD display @ 9600&#60;br /&#62;
  DIAG.begin(9600);                 // Diag comport - for program ack/nak/info&#60;br /&#62;
  delay(10000);                     // wait 10 seconds for POR for display and memory card init. Will show splash screen&#60;br /&#62;
  // move to 3 seconds to skip splash screen&#60;/p&#62;
&#60;p&#62;  DIAG.println(&#34;Check Comm. to 4D Labs Display&#34;); //&#60;br /&#62;
  uoled.begin(9600, &#38;amp;COMM);         // serial speed 9600&#60;br /&#62;
  // reset and initialize the display&#60;br /&#62;
  check_Res();                      // check response and print to Diag port&#60;br /&#62;
  COMM.flush();                     // clear serial buffer&#60;br /&#62;
  delay(1000);&#60;/p&#62;
&#60;p&#62;  DIAG.println(&#34;Change or step baud rate up to 128,000 max. baud&#34;); // uLCD does not have autobaud! &#60;/p&#62;
&#60;p&#62;  uoled.step_baud_up();             // new baud rate in uLED.cpp (adjustable)&#60;br /&#62;
  check_Res();                      // check response&#60;/p&#62;
&#60;p&#62;  COMM.end();                       // end &#34;old&#34; serial comm and restart at the new higher baudrate&#60;br /&#62;
  COMM.begin(128000);               // this value should match the same in uLED.cpp (adjustable)&#60;br /&#62;
  COMM.flush();                     // clear serial buffer &#60;/p&#62;
&#60;p&#62;  DIAG.println(&#34;Set Contrast to 5&#34;);&#60;br /&#62;
  uoled.SetContrast(5);             // set the contrast of the display to 5 (0 to 15 default (not always) is 8)&#60;br /&#62;
  check_Res();                      // check response&#60;br /&#62;
  delay(500);&#60;/p&#62;
&#60;p&#62;  DIAG.println(&#34;Show Device Display Info&#34;);&#60;br /&#62;
  uoled.DeviceInfo();               // display some hardware/software info of the screen&#60;br /&#62;
  COMM.flush();                     // clear serial buffer - info also when to the serial port! flush it.&#60;br /&#62;
  delay(3000);                      // info will be on screen for 3 seconds&#60;/p&#62;
&#60;p&#62;  DIAG.println(&#34;Clear screen&#34;);&#60;br /&#62;
  uoled.Cls();                      // clears the screen of everything on it. It uses the background color (at this moment it's at default black)&#60;br /&#62;
  uoled.Cls();                      // keep &#38;lt;---- bug fix - no res without it - needs 2 of them?&#60;br /&#62;
  check_Res();                      // check response&#60;/p&#62;
&#60;p&#62;  DIAG.println(&#34;Turn Touch On&#34;);&#60;br /&#62;
  uoled.DisplayControl(0x05,0x00);  // turn touch on&#60;br /&#62;
  check_Res();                      // check response &#60;/p&#62;
&#60;p&#62;  /* Set up the LED to blink  */&#60;br /&#62;
  pinMode(BLUE_LED_PIN, OUTPUT);&#60;/p&#62;
&#60;p&#62;  DIAG.println(&#34;redraw display&#34;);&#60;br /&#62;
  draw_uLCD_Display();&#60;/p&#62;
&#60;p&#62;  delay(10000);&#60;br /&#62;
  //DIAG.println(&#34;Turn display off&#34;);&#60;br /&#62;
  //uoled.SetDisplayState (0x00); //     display off -&#60;br /&#62;
  //delay(3000);&#60;br /&#62;
  //DIAG.println(&#34;Turn display on&#34;);&#60;br /&#62;
  //uoled.SetDisplayState (0x01); //     display on - no redraw necessary&#60;/p&#62;
&#60;p&#62;  //delay(5000);&#60;br /&#62;
  //DIAG.println(&#34;display powerdown - low power mode&#34;);&#60;br /&#62;
  //uoled.SetPowerState(0);              // display powerdown (low power mode) 0.080 ma.&#60;br /&#62;
  //delay(5000);&#60;br /&#62;
  //DIAG.println(&#34;display powerup&#34;);&#60;br /&#62;
  //uoled.SetPowerState(1);              // display powerup - redraw is necessary!&#60;br /&#62;
  //DIAG.println(&#34;set contrast&#34;);&#60;br /&#62;
  //uoled.SetContrast(5);                // set the contrast of the display to 5 (0 to 15 default (not always) is 8)&#60;br /&#62;
  //DIAG.println(&#34;redraw display&#34;);&#60;br /&#62;
  //draw_uLCD_Display();&#60;/p&#62;
&#60;p&#62;  startTime_T_Scan = millis();&#60;br /&#62;
  startTime_Screen_Saver = millis();&#60;/p&#62;
&#60;p&#62;  DIAG.println(&#34;Turn Touch On&#34;);&#60;br /&#62;
  uoled.DisplayControl(0x05,0x00);  // turn touch on&#60;br /&#62;
  check_Res();                      // check response&#60;/p&#62;
&#60;p&#62;  DIAG.println(&#34;Detect Touch Region&#34;);&#60;br /&#62;
  //void detect_Touch_Region(unsigned int x1,unsigned int y1,unsigned int x2,unsigned int y2);&#60;br /&#62;
  uoled.detect_Touch_Region(0,0,239,319);   // whole region &#38;lt;------ modify per application&#60;br /&#62;
  check_Res();                             // check response&#60;/p&#62;
&#60;p&#62;} // end of setup&#60;/p&#62;
&#60;p&#62;void loop()&#60;br /&#62;
{&#60;br /&#62;
  // uoled.x_res is the horizontal resolution of the display u are using.&#60;br /&#62;
  // uoled.y_res is the vertical resolution of the display u are using.&#60;/p&#62;
&#60;p&#62;  // portait uLCD-32PT(SGC)&#60;br /&#62;
  uoled.x_res = 240;&#60;br /&#62;
  uoled.y_res = 340;&#60;br /&#62;
  //-------------------------------------------------------------------------&#60;br /&#62;
  // do this when not doing touch scan - below&#60;br /&#62;
  //-------------------------------------------------------------------------&#60;br /&#62;
  toggle ^= 1;&#60;br /&#62;
  digitalWrite(BLUE_LED_PIN, toggle);&#60;br /&#62;
  //delay(50);&#60;/p&#62;
&#60;p&#62;  // blank screen after 5 minutes&#60;br /&#62;
  if ((millis() - startTime_Screen_Saver) &#38;gt; interval_Screen_Saver)&#60;br /&#62;
  {&#60;br /&#62;
    uoled.SetDisplayState (0x00);          // display off&#60;br /&#62;
    uoled.DisplayControl(0x00, 0x00);      // backlight off&#60;br /&#62;
    //startTime_Screen_Saver = millis();&#60;br /&#62;
  }&#60;br /&#62;
  //&#38;lt;------------------------------------------------------------------------&#124;&#124;&#124;&#60;br /&#62;
  // do Touch Scan every second&#60;br /&#62;
  if ((millis() - startTime_T_Scan) &#38;gt; interval_T_Scan){&#60;/p&#62;
&#60;p&#62;     uoled.get_Touch_Coord(0x00); // wait for touch activity&#60;br /&#62;
    // response will be 4 bytes or nothing ... the screen has to be pressed before calling this function for a vaid response.&#60;/p&#62;
&#60;p&#62;    DIAG.println((millis() - startTime_Screen_Saver),DEC); // print millis for screen saver&#60;/p&#62;
&#60;p&#62;    if ((uoled.coor_x == 0) &#124;&#124; (uoled.coor_y == 0))&#60;br /&#62;
    {&#60;br /&#62;
    }&#60;br /&#62;
    else&#60;br /&#62;
    {&#60;br /&#62;
      // for test only&#60;br /&#62;
      //DIAG.println(uoled.byte1,DEC);&#60;br /&#62;
      //DIAG.println(uoled.byte2,DEC);&#60;br /&#62;
      //DIAG.println(uoled.byte3,DEC);&#60;br /&#62;
      //DIAG.println(uoled.byte4,DEC);&#60;br /&#62;
      DIAG.print(&#34;Touch Response COOR. x=&#34;);&#60;br /&#62;
      DIAG.print(uoled.coor_x,DEC);&#60;br /&#62;
      DIAG.print(&#34; y=&#34;);&#60;br /&#62;
      DIAG.println(uoled.coor_y,DEC);&#60;br /&#62;
      // for screen saver&#60;br /&#62;
      uoled.SetDisplayState (0x01);      // display on - no redraw necessary&#60;br /&#62;
      uoled.DisplayControl(0x00, 0x01);  // backlight on&#60;br /&#62;
      //startTime_Screen_Saver = millis(); // restart screen saver timer &#38;lt;-- for&#60;br /&#62;
        troubleshooting&#60;br /&#62;
    }&#60;br /&#62;
    COMM.flush(); // flush the trash after every touch scan &#38;lt;--------------------&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#38;lt;&#60;/p&#62;
&#60;p&#62;    startTime_T_Scan = millis(); // restart millis timer&#60;br /&#62;
  } // end of millis &#34;if&#34;&#60;/p&#62;
&#60;p&#62;}  // end of main loop&#60;br /&#62;
//------------------------------------------------------------------------------&#60;br /&#62;
//------------------------------------------------------------------------------
&#60;/p&#62;</description>
		</item>
		<item>
			<title>leaflabsandy on "Just curious ... Millis();"</title>
			<link>http://forums.leaflabs.com/topic.php?id=155#post-992</link>
			<pubDate>Sat, 04 Sep 2010 08:24:28 +0000</pubDate>
			<dc:creator>leaflabsandy</dc:creator>
			<guid isPermaLink="false">992@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Quote: &#34;That does sound like a buffer or array overrun/underrun, or a deep bug.&#34;&#60;/p&#62;
&#60;p&#62;Reply: No, I use the serial flush command this prevents the &#34;Blue Status LED Throbbing&#34;&#60;/p&#62;
&#60;p&#62;Quote: &#34;Have you some other arrays?&#60;/p&#62;
&#60;p&#62;Can you over-allocate arrays to see if the problem changes?&#60;/p&#62;
&#60;p&#62;Is there a practical way to check for overrun/underrun? E.g. would the code support putting 'padding' (extra space) around the arrays, and fill the 'padding' with a distinct non-zero 'sentinel' value, then check the padding sentinel values are unchanged?&#60;/p&#62;
&#60;p&#62;Reply: No arrays are used.&#60;/p&#62;
&#60;p&#62;TZ = EST
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Just curious ... Millis();"</title>
			<link>http://forums.leaflabs.com/topic.php?id=155#post-990</link>
			<pubDate>Sat, 04 Sep 2010 07:33:36 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">990@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;While digging, I noticed a tiny, but annoying detail, which should make no difference to the bug, but thwarted my grep.&#60;/p&#62;
&#60;p&#62;class HarwareSerial is declared as&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;class HardwareSerial : public Print {
    ...
    virtual void write(unsigned char);
    ...
};&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;the Print class hasn't got the corresponding textual form:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;class Print
{
  ...
  public:
    virtual void write(uint8) = 0;
    ...
};&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;So I was grep'ing for 'write(unsigned char' and couldn't find it! So I went and looked at every 'write'.&#60;/p&#62;
&#60;p&#62;I accept this is a miniscule detail, but it would have saved a little bit of time. So LeafLabs, would you add fixing that as a low priority (as if such low priorities ever work their way to the front of the queue :-)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Just curious ... Millis();"</title>
			<link>http://forums.leaflabs.com/topic.php?id=155#post-989</link>
			<pubDate>Sat, 04 Sep 2010 07:10:06 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">989@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;That does sound like a buffer or array overrun/underrun, or a deep bug.&#60;/p&#62;
&#60;p&#62;Have you some other arrays?&#60;/p&#62;
&#60;p&#62;Can you over-allocate arrays to see if the problem changes?&#60;/p&#62;
&#60;p&#62;Is there a practical way to check for overrun/underrun? E.g. would the code support putting 'padding' (extra space) around the arrays, and fill the 'padding' with a distinct non-zero 'sentinel' value, then check the padding sentinel values are unchanged?&#60;/p&#62;
&#60;p&#62;Maybe if you want to publish code, someone might see something?&#60;br /&#62;
Sorry I can't be more helpful. &#60;/p&#62;
&#60;p&#62;(BTW - May I ask, what time zone are you in? I read your post a couple of hours ago (then 5 hours old), did some digging, wrote a reply, and you're back within the hour - I'm impressed:-)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>leaflabsandy on "Just curious ... Millis();"</title>
			<link>http://forums.leaflabs.com/topic.php?id=155#post-987</link>
			<pubDate>Sat, 04 Sep 2010 06:45:08 +0000</pubDate>
			<dc:creator>leaflabsandy</dc:creator>
			<guid isPermaLink="false">987@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;My Quote: &#34;I am hammering both comports #1 &#38;amp; #2, and millis seems to reset on comport #2 activity.&#34;&#60;/p&#62;
&#60;p&#62;Change &#34;seems&#34; to &#34;is&#34; ... millis is reseting to zero then restarting on comport #2 activity.&#60;/p&#62;
&#60;p&#62;Quote: &#34;do you mean becomes zero (or very close), or jumps about?&#34;&#60;/p&#62;
&#60;p&#62;Reply: reset to zero and starts counting again. (no jumping about)&#60;/p&#62;
&#60;p&#62;Quote: &#34;Is it possible that a buffer is overrunning&#34;&#60;/p&#62;
&#60;p&#62;Reply: No, I am using serial2.flush to prevent this from happening.&#60;br /&#62;
       I found out by overrunning a receiver buffer will bring about&#60;br /&#62;
       &#34;The Blue Status LED Throbbing&#34; which halts the ARM in an infinite loop.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Just curious ... Millis();"</title>
			<link>http://forums.leaflabs.com/topic.php?id=155#post-986</link>
			<pubDate>Sat, 04 Sep 2010 05:32:49 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">986@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;When you write that &#34;millis() seems to reset&#34;, do you mean becomes zero (or very close), or jumps about?&#60;/p&#62;
&#60;p&#62;The underlying value used by millis(), called systick_timer_millis, is updated by the interrupt service routine of a special purpose timer called SysTick timer.&#60;br /&#62;
The SysTick timer is an independent interrupt, unrelated to, e.g. the USARTs (RM0008 Reference Manual, document 13902.pdf from st.com).&#60;/p&#62;
&#60;p&#62;I had a look at the millis() maplelib source, and the underlying SysTick timer source. After digging through the RM0008 processor manual, and &#34;STM32F10xxx Cortex™-M3 programming manual (PM0056)&#34;, I can honestly say, I don't know what might be causing that. &#60;/p&#62;
&#60;p&#62;The processor shouldn't lose any interrupts as long as their is enough time to process them all.&#60;br /&#62;
I failed to figure out which has a higher interrupt priority between the USARTs and SysTick, so I can't tell if it is possible for a USART to starve the SysTick interrupt handler, but I can't think how that might be possible.&#60;/p&#62;
&#60;p&#62;Edit: { I didn't find where the interrupt handlers are attached to the interrupts, but I can't see that the code might be called sometimes and not others, unless there is a significant bug. I can't see how USART2 might cause this.&#60;/p&#62;
&#60;p&#62;Also, the systick_timer_millis is a 32bit value, so even if, somehow, two pieces of code tried to update it, updates might be lost, causing it to increase less often than it should, but I don't understand how it might get reset or jump around.&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;Is it possible that a buffer is overrunning, and writing on millis() underlying systick_timer_millis SysTick timer value?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>leaflabsandy on "Just curious ... Millis();"</title>
			<link>http://forums.leaflabs.com/topic.php?id=155#post-983</link>
			<pubDate>Fri, 03 Sep 2010 22:29:34 +0000</pubDate>
			<dc:creator>leaflabsandy</dc:creator>
			<guid isPermaLink="false">983@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Is the timing of &#34;millis();&#34; somehow in anyway tied to Serial comport #2 via&#60;br /&#62;
interrupts or timers or DMA?&#60;/p&#62;
&#60;p&#62;I am hammering both comports #1 &#38;amp; #2, and millis seems to reset on comport #2 activity.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
