Teensy 3.x multithreading library first release

It's ColinK's FlexCAN library, so it's CANListener::gotFrame.
I forgot about the name change - it's frameHandler now. In any case, it's directly called from an ISR. You can't use new / malloc / delete / free in there (creating a thread would do that) or you risk memory corruption. Accessing any global data from the ISR without synchronization is unsafe (e.g. sharing data with your 'loop()').

You don't want to do blocking serial writes (check that enough TX buffer space is available before calling), the ISR will block anything with equal or lower priority. With the default interrupt priorities, it will block serial transmission (the serial port can't send, since its interrupt is blocked) - this explains why you saw Teensy hanging. This can still happen with your larger buffer size, so make sure to add a TX buffer check, if you keep doing serial writes in gotFrame / frameHandler (just throw away the message, if you run out of buffer space).
 
I forgot about the name change - it's frameHandler now. In any case, it's directly called from an ISR. You can't use new / malloc / delete / free in there (creating a thread would do that) or you risk memory corruption. Accessing any global data from the ISR without synchronization is unsafe (e.g. sharing data with your 'loop()').

Although I haven't tried it from an ISR, if you pass the `stack` and `stack_size` parameters to the addThread(), there won't be any calls to malloc/new. You just need to allocate and delete it somewhere else, or just make the stack static and global. So maybe it is possible to create a thread within an ISR. See: "int Threads::addThread(ThreadFunction p, void * arg, int stack_size, void *stack)"
 
Any idea why this might be happening (adding Teensy Threads breaks intellisense):
Withouth TeenyThreads.h
withoutThreads_h_zpsjzzjsh7m.jpg

With TeensyThreads.h
withThreads_h_zpso2ihnfne.jpg
 
Any idea why this might be happening (adding Teensy Threads breaks intellisense):
Withouth TeenyThreads.h
Are you referring to the color of keywords being off in the lower screen? This could be a problem in the code syntax in the headers or perhaps conflicting #defines. What editor are you using? Is it VisualStudio on Windows? What FastLED library (version and location where I could download it)?
 
I know this is a silly suggestion but did you try and put TeensyThreads.h before FastLed.h. Do you still see the problem? What happens if you compile the code? Do you get any error messages?
 
I've moved it everywhere.

Causes the same issue. I use Visual Studio 2017 Professional to write. I despise the Arduino IDE and I've used Borland or Visual Studio my entire career. Just used to intellisense. Thought it was curious that this library seems to break it.

I also use VisualMicro professional plugin. It allows parrallel builds and some other functionality like an additional toolbar:
vMicroSnip_zpsvoqzafnb.jpg


Haven't tested it with VS 2015 yet.

https://msdn.microsoft.com/en-us/library/hcw1s69b.aspx

"FastLED version 3.001.005"
https://github.com//FastLED/FastLED

Compile Errors are as follows:
Code:
TeensyThreads.h: 321:19: error: declaration does not declare anything [-fpermissive]
   #define typeof(a) decltype(a)
pgmspace.h:106: note  in expansion of macro typeof
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:466: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   CRGB xyz   =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
Last edited:
Just tested it on VS2015 with Update 1 installed. It seems to work fine. I didn't notice any change with or without TeensyThreads.
 
This is my entire .ino file (Testing in Visual Studio 2015 Professional):
Code:
#include "TeensyThreads\TeensyThreads.h"
#include "FastLED\FastLED.h"
void setup()
{

  /* add setup code here */

}

void loop()
{

  /* add main program code here */

}

Here is the compiler output:
Code:
Compiling debug version of 'ThreadAndFastLEDTest' for 'Teensy 3.2 / 3.1'
 
ThreadAndFastLEDTest.ino: In file included from
FastLED.h:17: note  #pragma message  FastLED version 3.001.005
   #    pragma message "FastLED version 3.001.005"
 
ThreadAndFastLEDTest.ino: In file included from
colorutils.h: In constructor CHSVPalette16::CHSVPalette16(const uint32_t (&)[16])
 
TeensyThreads.h: 321:19: error: declaration does not declare anything [-fpermissive]
   #define typeof(a) decltype(a)
pgmspace.h:106: note  in expansion of macro typeof
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:466: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   CRGB xyz   =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
WProgram.h:11: In file included from
arduino.h:1: from
ThreadAndFastLEDTest.ino: from
 
pgmspace.h: 106:15: error: '_addr' was not declared in this scope
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:466: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   CRGB xyz   =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
pgmspace.h: 107:33: error: conversion from 'void' to non-scalar type 'CRGB' requested
   *(const unsigned long *)(_addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:466: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   CRGB xyz   =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
ThreadAndFastLEDTest.ino: In file included from
colorutils.h: In member function CHSVPalette16& CHSVPalette16::operator=(const uint32_t (&)[16])
 
TeensyThreads.h: 321:19: error: declaration does not declare anything [-fpermissive]
   #define typeof(a) decltype(a)
pgmspace.h:106: note  in expansion of macro typeof
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:475: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   CRGB xyz   =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
WProgram.h:11: In file included from
arduino.h:1: from
ThreadAndFastLEDTest.ino: from
 
pgmspace.h: 106:15: error: '_addr' was not declared in this scope
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:475: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   CRGB xyz   =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
pgmspace.h: 107:33: error: conversion from 'void' to non-scalar type 'CRGB' requested
   *(const unsigned long *)(_addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:475: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   CRGB xyz   =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
ThreadAndFastLEDTest.ino: In file included from
colorutils.h: In constructor CRGBPalette16::CRGBPalette16(const uint32_t (&)[16])
 
TeensyThreads.h: 321:19: error: declaration does not declare anything [-fpermissive]
   #define typeof(a) decltype(a)
pgmspace.h:106: note  in expansion of macro typeof
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:710: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   entries[i] =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
WProgram.h:11: In file included from
arduino.h:1: from
ThreadAndFastLEDTest.ino: from
 
pgmspace.h: 106:15: error: '_addr' was not declared in this scope
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:710: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   entries[i] =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
FastLED.h:58: In file included from
ThreadAndFastLEDTest.ino: from
 
colorutils.h: 710:24: error: no match for 'operator=' (operand types are 'CRGB' and 'void')
   entries[i] =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
controller.h:9: In file included from
FastLED.h:47: from
ThreadAndFastLEDTest.ino: from
pixeltypes.h:167: note  candidate  CRGB& CRGB  operator=(const CRGB&)
   inline CRGB& operator= (const CRGB& rhs) __attribute__((always_inline))
pixeltypes.h:167: note    no known conversion for argument 1 from void to const CRGB&
pixeltypes.h:176: note  candidate  CRGB& CRGB  operator=(uint32_t)
   inline CRGB& operator= (const uint32_t colorcode) __attribute__((always_inline))
pixeltypes.h:176: note    no known conversion for argument 1 from void to uint32_t {aka long unsigned int}
pixeltypes.h:208: note  candidate  CRGB& CRGB  operator=(const CHSV&)
   inline CRGB& operator= (const CHSV& rhs) __attribute__((always_inline))
pixeltypes.h:208: note    no known conversion for argument 1 from void to const CHSV&
 
ThreadAndFastLEDTest.ino: In file included from
colorutils.h: In member function CRGBPalette16& CRGBPalette16::operator=(const uint32_t (&)[16])
 
TeensyThreads.h: 321:19: error: declaration does not declare anything [-fpermissive]
   #define typeof(a) decltype(a)
pgmspace.h:106: note  in expansion of macro typeof
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:716: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   entries[i] =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
WProgram.h:11: In file included from
arduino.h:1: from
ThreadAndFastLEDTest.ino: from
 
pgmspace.h: 106:15: error: '_addr' was not declared in this scope
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:716: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   entries[i] =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
FastLED.h:58: In file included from
ThreadAndFastLEDTest.ino: from
 
colorutils.h: 716:24: error: no match for 'operator=' (operand types are 'CRGB' and 'void')
   entries[i] =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
controller.h:9: In file included from
FastLED.h:47: from
ThreadAndFastLEDTest.ino: from
pixeltypes.h:167: note  candidate  CRGB& CRGB  operator=(const CRGB&)
   inline CRGB& operator= (const CRGB& rhs) __attribute__((always_inline))
pixeltypes.h:167: note    no known conversion for argument 1 from void to const CRGB&
pixeltypes.h:176: note  candidate  CRGB& CRGB  operator=(uint32_t)
   inline CRGB& operator= (const uint32_t colorcode) __attribute__((always_inline))
pixeltypes.h:176: note    no known conversion for argument 1 from void to uint32_t {aka long unsigned int}
pixeltypes.h:208: note  candidate  CRGB& CRGB  operator=(const CHSV&)
   inline CRGB& operator= (const CHSV& rhs) __attribute__((always_inline))
pixeltypes.h:208: note    no known conversion for argument 1 from void to const CHSV&
 
ThreadAndFastLEDTest.ino: In file included from
colorutils.h: In member function CRGBPalette16& CRGBPalette16::operator=(TProgmemRGBGradientPalette_bytes)
 
TeensyThreads.h: 321:19: error: declaration does not declare anything [-fpermissive]
   #define typeof(a) decltype(a)
pgmspace.h:106: note  in expansion of macro typeof
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:830: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   u.dword = FL_PGM_READ_DWORD_NEAR(progent + count)
 
WProgram.h:11: In file included from
arduino.h:1: from
ThreadAndFastLEDTest.ino: from
 
pgmspace.h: 106:15: error: '_addr' was not declared in this scope
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:830: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   u.dword = FL_PGM_READ_DWORD_NEAR(progent + count)
 
FastLED.h:58: In file included from
ThreadAndFastLEDTest.ino: from
 
colorutils.h: 830:21: error: void value not ignored as it ought to be
   u.dword = FL_PGM_READ_DWORD_NEAR(progent + count)
 
ThreadAndFastLEDTest.ino: In file included from
 
TeensyThreads.h: 321:19: error: declaration does not declare anything [-fpermissive]
   #define typeof(a) decltype(a)
pgmspace.h:106: note  in expansion of macro typeof
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:836: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   u.dword = FL_PGM_READ_DWORD_NEAR( progent)
 
WProgram.h:11: In file included from
arduino.h:1: from
ThreadAndFastLEDTest.ino: from
 
pgmspace.h: 106:15: error: '_addr' was not declared in this scope
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:836: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   u.dword = FL_PGM_READ_DWORD_NEAR( progent)
 
FastLED.h:58: In file included from
ThreadAndFastLEDTest.ino: from
 
colorutils.h: 836:17: error: void value not ignored as it ought to be
   u.dword = FL_PGM_READ_DWORD_NEAR( progent)
 
ThreadAndFastLEDTest.ino: In file included from
 
TeensyThreads.h: 321:19: error: declaration does not declare anything [-fpermissive]
   #define typeof(a) decltype(a)
pgmspace.h:106: note  in expansion of macro typeof
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:844: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   u.dword = FL_PGM_READ_DWORD_NEAR( progent)
 
WProgram.h:11: In file included from
arduino.h:1: from
ThreadAndFastLEDTest.ino: from
 
pgmspace.h: 106:15: error: '_addr' was not declared in this scope
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:844: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   u.dword = FL_PGM_READ_DWORD_NEAR( progent)
 
FastLED.h:58: In file included from
ThreadAndFastLEDTest.ino: from
 
colorutils.h: 844:21: error: void value not ignored as it ought to be
   u.dword = FL_PGM_READ_DWORD_NEAR( progent)
 
ThreadAndFastLEDTest.ino: In file included from
colorutils.h: In constructor CHSVPalette32::CHSVPalette32(const uint32_t (&)[32])
 
TeensyThreads.h: 321:19: error: declaration does not declare anything [-fpermissive]
   #define typeof(a) decltype(a)
pgmspace.h:106: note  in expansion of macro typeof
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:942: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   CRGB xyz   =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
WProgram.h:11: In file included from
arduino.h:1: from
ThreadAndFastLEDTest.ino: from
 
pgmspace.h: 106:15: error: '_addr' was not declared in this scope
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:942: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   CRGB xyz   =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
pgmspace.h: 107:33: error: conversion from 'void' to non-scalar type 'CRGB' requested
   *(const unsigned long *)(_addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:942: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   CRGB xyz   =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
ThreadAndFastLEDTest.ino: In file included from
colorutils.h: In member function CHSVPalette32& CHSVPalette32::operator=(const uint32_t (&)[32])
 
TeensyThreads.h: 321:19: error: declaration does not declare anything [-fpermissive]
   #define typeof(a) decltype(a)
pgmspace.h:106: note  in expansion of macro typeof
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:951: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   CRGB xyz   =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
WProgram.h:11: In file included from
arduino.h:1: from
ThreadAndFastLEDTest.ino: from
 
pgmspace.h: 106:15: error: '_addr' was not declared in this scope
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:951: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   CRGB xyz   =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
pgmspace.h: 107:33: error: conversion from 'void' to non-scalar type 'CRGB' requested
   *(const unsigned long *)(_addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:951: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   CRGB xyz   =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
ThreadAndFastLEDTest.ino: In file included from
colorutils.h: In constructor CRGBPalette32::CRGBPalette32(const uint32_t (&)[32])
 
TeensyThreads.h: 321:19: error: declaration does not declare anything [-fpermissive]
   #define typeof(a) decltype(a)
pgmspace.h:106: note  in expansion of macro typeof
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:1084: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   entries[i] =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
WProgram.h:11: In file included from
arduino.h:1: from
ThreadAndFastLEDTest.ino: from
 
pgmspace.h: 106:15: error: '_addr' was not declared in this scope
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:1084: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   entries[i] =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
FastLED.h:58: In file included from
ThreadAndFastLEDTest.ino: from
 
colorutils.h: 1084:24: error: no match for 'operator=' (operand types are 'CRGB' and 'void')
   entries[i] =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
controller.h:9: In file included from
FastLED.h:47: from
ThreadAndFastLEDTest.ino: from
pixeltypes.h:167: note  candidate  CRGB& CRGB  operator=(const CRGB&)
   inline CRGB& operator= (const CRGB& rhs) __attribute__((always_inline))
pixeltypes.h:167: note    no known conversion for argument 1 from void to const CRGB&
pixeltypes.h:176: note  candidate  CRGB& CRGB  operator=(uint32_t)
   inline CRGB& operator= (const uint32_t colorcode) __attribute__((always_inline))
pixeltypes.h:176: note    no known conversion for argument 1 from void to uint32_t {aka long unsigned int}
pixeltypes.h:208: note  candidate  CRGB& CRGB  operator=(const CHSV&)
   inline CRGB& operator= (const CHSV& rhs) __attribute__((always_inline))
pixeltypes.h:208: note    no known conversion for argument 1 from void to const CHSV&
 
ThreadAndFastLEDTest.ino: In file included from
colorutils.h: In member function CRGBPalette32& CRGBPalette32::operator=(const uint32_t (&)[32])
 
TeensyThreads.h: 321:19: error: declaration does not declare anything [-fpermissive]
   #define typeof(a) decltype(a)
pgmspace.h:106: note  in expansion of macro typeof
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:1090: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   entries[i] =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
WProgram.h:11: In file included from
arduino.h:1: from
ThreadAndFastLEDTest.ino: from
 
pgmspace.h: 106:15: error: '_addr' was not declared in this scope
   typeof(addr) _addr = (addr)
pgmspace.h:118: note  in expansion of macro pgm_read_dword
   #define pgm_read_dword_near(addr) pgm_read_dword(addr)
fastled_progmem.h:41: note  in expansion of macro pgm_read_dword_near
   #define FL_PGM_READ_DWORD_NEAR(x) (pgm_read_dword_near(x))
colorutils.h:1090: note  in expansion of macro FL_PGM_READ_DWORD_NEAR
   entries[i] =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
FastLED.h:58: In file included from
ThreadAndFastLEDTest.ino: from
 
colorutils.h: 1090:24: error: no match for 'operator=' (operand types are 'CRGB' and 'void')
   entries[i] =  FL_PGM_READ_DWORD_NEAR( rhs + i)
 
controller.h:9: In file included from
FastLED.h:47: from
ThreadAndFastLEDTest.ino: from
pixeltypes.h:167: note  candidate  CRGB& CRGB  operator=(const CRGB&)
   inline CRGB& operator= (const CRGB& rhs) __attribute__((always_inline))
pixeltypes.h:167: note    no known conversion for argument 1 from void to const CRGB&
pixeltypes.h:176: note  candidate  CRGB& CRGB  operator=(uint32_t)
   inline CRGB& operator= (const uint32_t colorcode) __attribute__((always_inline))
pixeltypes.h:176: note    no known conversion for argument 1 from void to uint32_t {aka long unsigned int}
pixeltypes.h:208: note  candidate  CRGB& CRGB  operator=(const CHSV&)
   inline CRGB& operator= (const CHSV& rhs) __attribute__((always_inline))
pixeltypes.h:208: note    no known conversion for argument 1 from void to const CHSV&
 
ThreadAndFastLEDTest.ino: In file included from
colorutils.h: In member function CRGBPalette32& CRGBPalette32::operator=(TProgmemRGBGradientPalette_bytes)
 
TeensyThreads.h: 321:19: error: declaration does not declare anything [-fpermissive]
   #define typeof(a) decltype(a)
Error compiling project sources
Debug build failed for project 'ThreadAndFastLEDTest'
 
@Detroit_Aristo - thanks for the additional info. I think generally in this forum we assume people are using Arduino and the Teensyduino libraries and compiler, and unmodified libraries, so if there's anything that deviates from that, it's good to know.

I'm having a little difficulty matching up the code to your error messages. Line 321 of TeensyThreads.h is not:
Code:
   #define typeof(a) decltype(a)

Did you make any changes to TeensyThreads.h? Or am I reading the output wrong? typeof() is a GCC extension, so not sure what remapping it to decltype() will do to the rest of the code. Are you using GCC that comes with Teensyduino? If not, what compiler and version are you using?

In any case, typeof() is used in line 315. It should probably be changed to decltype() anyway, which is in the newer C++11 standard. So you might want to change it to the following to see if that helps.

Code:
// #define ThreadWrap(OLDOBJ, NEWOBJ) Threads::Grab<typeof(OLDOBJ)> NEWOBJ(OLDOBJ);
#define ThreadWrap(OLDOBJ, NEWOBJ) Threads::Grab<decltype(OLDOBJ)> NEWOBJ(OLDOBJ);
 
Thanks Fritas.

I haven't changed anything. I am using the compiler that comes with TD 1.36. vMicro depends on on it for whatever the compiler is. I will investigate more this evening.
 
Interesting I just did a quicky test by using by one of the fastled examples combined with the blink thread example and it compiled without errors (VS2015 update 1 with ide 1.8.2, latest version from github):

Code:
Compiling 'Cylon' for 'Teensy 3.5'
 
Cylon.ino: In file included from
FastLED.h:17: note  #pragma message  FastLED version 3.001.005
   #    pragma message "FastLED version 3.001.005"
Program size: 32,996 bytes (used 6% of a 524,288 byte maximum) (48.55 secs)
Minimum Memory Usage: 6908 bytes (4% of a 196608 byte maximum)
 
   Opening Teensy Loader

Same result for Teens 3.1/3.2 board. Here is the pgm in case you want to test:
Code:
#include "FastLED\FastLED.h"
#include "TeensyThreads\TeensyThreads.h"

const int LED = 13;

volatile int blinkcode = 0;

void blinkthread() {
	while (1) {
		if (blinkcode) {
			for (int i = 0; i<blinkcode; i++) {
				digitalWrite(LED, HIGH);
				threads.delay(150);
				digitalWrite(LED, LOW);
				threads.delay(150);
			}
			blinkcode = 0;
		}
		threads.yield();
	}
}

// How many leds in your strip?
#define NUM_LEDS 64 

// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN.  For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806, define both DATA_PIN and CLOCK_PIN
#define DATA_PIN 7
#define CLOCK_PIN 13

// Define the array of leds
CRGB leds[NUM_LEDS];

void setup() { 
	Serial.begin(57600);
	Serial.println("resetting");
	delay(1000);
	pinMode(LED, OUTPUT);
	threads.addThread(blinkthread);
	LEDS.addLeds<WS2812,DATA_PIN,RGB>(leds,NUM_LEDS);
	LEDS.setBrightness(84);
}

void fadeall() { for(int i = 0; i < NUM_LEDS; i++) { leds[i].nscale8(250); } }

int count = 0;

void loop() { 
	count++;
	blinkcode = count;
	delay(5000);

	static uint8_t hue = 0;
	Serial.print("x");
	// First slide the led in one direction
	for(int i = 0; i < NUM_LEDS; i++) {
		// Set the i'th led to red 
		leds[i] = CHSV(hue++, 255, 255);
		// Show the leds
		FastLED.show(); 
		// now that we've shown the leds, reset the i'th led to black
		// leds[i] = CRGB::Black;
		fadeall();
		// Wait a little bit before we loop around and do it again
		delay(10);
	}
	Serial.print("x");

	// Now go in the other direction.  
	for(int i = (NUM_LEDS)-1; i >= 0; i--) {
		// Set the i'th led to red 
		leds[i] = CHSV(hue++, 255, 255);
		// Show the leds
		FastLED.show();
		// now that we've shown the leds, reset the i'th led to black
		// leds[i] = CRGB::Black;
		fadeall();
		// Wait a little bit before we loop around and do it again
		delay(10);
	}
}
 
Thanks Fritas.

I haven't changed anything. I am using the compiler that comes with TD 1.36. vMicro depends on on it for whatever the compiler is. I will investigate more this evening.

What would also be helpful is if you can show the exact gcc command being executed. Since you are using a different build environment, it could be not passing the right -D or other options.
 
Had a thought while I was out. Did you update vMicro/VS to point to the Arduino ide directory that has teensyduino 1.36 installed?
 
Had a thought while I was out. Did you update vMicro/VS to point to the Arduino ide directory that has teensyduino 1.36 installed?

It's the only install of TD I have, yes. I will verify this evening. With the responses here, It has to be something in my compiler or options that's causing this.

I am overly excited to use the library. It looks like the perfect library to do what I want. (Update LEDS outside of the main program loop).
 
Interesting I just did a quicky test by using by one of the fastled examples combined with the blink thread example and it compiled without errors (VS2015 update 1 with ide 1.8.2, latest version from github):

That worked without issue. Strange. I am not sure what's happening here. Just created a new project, added your code via copy/paste and it built with no problems.

Program cylon size: 27,724 bytes (used 11% of a 262,144 byte maximum) (17.71 secs)
Minimum Memory Usage: 5536 bytes (8% of a 65536 byte maximum)

Something's funky with my project properties on the main project it seems.
 
And here is the .ino that I am using.

Code:
//#include "TeensyThreads\TeensyThreads.h"
#include "FastLED\FastLED.h"

#define ledDisplay Serial1
uint8_t *message;
static int messageIndex = 0;
static bool footwellOn = false, partyTimeOn = false, RearOverheadOn = false, underglowOn = false, dancingOn = false;
//tFootWell = 2, tPtyTme = 3, tRearOvr = 4, tUnderGlow = 5, tDance = 6 

//FastLED Section
#define NUM_LEDS_OVERHEAD 10
#define DATA_PIN_OVERHEAD 14
#define NUM_LEDS_FOOTWELL 20
#define DATA_PIN_FOOTWELL 2
#define NUM_LEDS_UNDERGLOW 100
#define DATA_PIN_UNDERGLOW 7
CRGB footWell[NUM_LEDS_FOOTWELL];
CRGB overHead[NUM_LEDS_OVERHEAD];
CRGB underGlow[NUM_LEDS_UNDERGLOW];
CLEDController* strips[6];
static uint8_t gBrightness = 75;
static uint8_t hue = 0;

// the setup function runs once when you press reset or power the board
void setup() {
	Serial.begin(115200);
	ledDisplay.begin(115200);
	Serial.println("Started and attached");
	message = new uint8_t[7]{ 0,0,0,0,0,0,0 };
	pinMode(LED_BUILTIN, OUTPUT);
	strips[0] = nullptr;
	strips[1] = nullptr;
	strips[2] = &FastLED.addLeds<NEOPIXEL, DATA_PIN_FOOTWELL>(footWell, NUM_LEDS_FOOTWELL);
	strips[3] = nullptr;
	strips[4] = &FastLED.addLeds<NEOPIXEL, DATA_PIN_OVERHEAD>(overHead, NUM_LEDS_OVERHEAD);	
	strips[5] = &FastLED.addLeds<NEOPIXEL, DATA_PIN_UNDERGLOW>(underGlow, NUM_LEDS_UNDERGLOW);
}

void loop() {
	if (ledDisplay.available() > 0)
	{
		serialEventCallbackHandler(messageIndex);
	}
	else
	{
		messageIndex = 0;
	}
	switch (message[2])
	{
	case 2:
		footwellOn = !footwellOn;
		if (footwellOn)
		{
			Serial.println("Footwell LED ON");
			fill_solid(footWell, NUM_LEDS_FOOTWELL, CRGB::Blue);
			strips[2]->showLeds(gBrightness);
		}
		else
		{
			Serial.println("Footwell LED OFF");
			fill_solid(footWell, NUM_LEDS_FOOTWELL, CRGB::Black);
			strips[2]->showLeds(gBrightness);
		}
		message[2] = 0;
		break;
	case 3:
		partyTimeOn = !partyTimeOn;
		if (partyTimeOn)
		{
			Serial.println("partyTimeOn ON");
			if (footwellOn)
			{
				Serial.println("Making Party");
				cylonMe(NUM_LEDS_FOOTWELL, footWell);
				Serial.println("Party Function Over");
			}
		}
		else
		{
			Serial.println("partyTimeOn OFF");
		}
		message[2] = 0;
		break;
	case 4:
		RearOverheadOn = !RearOverheadOn;
		if (RearOverheadOn)
		{
			Serial.println("RearOverheadOn LED ON");
			fill_solid(overHead, NUM_LEDS_OVERHEAD, CRGB::Red);
			strips[4]->showLeds(gBrightness);
		}
		else
		{
			Serial.println("RearOverheadOn LED OFF");
			fill_solid(overHead, NUM_LEDS_OVERHEAD, CRGB::Black);
			strips[4]->showLeds(gBrightness);
		}
		message[2] = 0;
		break;
	case 5:
		underglowOn = !underglowOn;
		if (underglowOn)
		{
			Serial.println("underglowOn LED ON");
		}
		else
		{
			Serial.println("underglowOn LED OFF");
		}
		message[2] = 0;
		break;
	case 6:
		dancingOn = !dancingOn;
		if (dancingOn)
		{
			Serial.println("dancing ON");
		}
		else
		{
			Serial.println("dancing OFF");
		}
		message[2] = 0;
		break;
	case 11:
		if (gBrightness >= 250)
		{
			gBrightness = 255;
			Serial.print("Brightness is: ");
			Serial.println(gBrightness, DEC);
		}
		else 
		{
			gBrightness += 10;
			Serial.println("Brightness UP");
		}
		
		for (int t = 0; t < 6; t++)
		{
			if (strips[t] != nullptr)
			{
				strips[t]->showLeds(gBrightness);
			}
		}
		message[2] = 0;

		break;
	case 12:
		if (gBrightness <= 10)
		{
			gBrightness = 0;
			Serial.print("Brightness is: ");
			Serial.println(gBrightness, DEC);
		}
		else 
		{
			gBrightness -= 10;
			Serial.println("Brightness DOWN");
		}		
		for (int t = 0; t < 6; t++)
		{
			if (strips[t] != nullptr)
			{
				strips[t]->showLeds(gBrightness);
			}
		}
		message[2] = 0;
		break;
	default:
		break;
	}
	delay(20);
}
void serialEventCallbackHandler(int ctr)
{
	uint8_t incomingByte;
	incomingByte = ledDisplay.read();
	message[ctr] = (uint8_t)incomingByte;
	messageIndex++;

	return;
}
void fadeall(CRGB* leds, int NUM_LEDS)
{
	for (int i = 0; i < (NUM_LEDS) / 2; i++)
	{
		leds[i].nscale8(250);
		leds[i + 10].nscale8(250);
	}
}
void cylonMe(int NUM_LEDS, CRGB* leds)
{
	int n = 0;
	while (n < 15)
	{
		for (int i = 0; i < (NUM_LEDS) / 2; i++) {
			leds[i] = CHSV(hue++, 255, 255);
			leds[i + 10] = CHSV(hue++, 255, 255);
			// Show the leds
			strips[2]->showLeds(gBrightness);
			leds[i] = CRGB::Black;
			leds[i + 10] = CRGB::Black;
			fadeall(leds, NUM_LEDS);
			delay(10);
		}
		for (int i = ((NUM_LEDS)-1) / 2; i >= 0; i--) {
			leds[i] = CHSV(hue++, 255, 255);
			leds[i + 10] = CHSV(hue++, 255, 255);
			strips[2]->showLeds(gBrightness);
			leds[i] = CRGB::Black;
			leds[i + 10] = CRGB::Black;
			fadeall(leds, NUM_LEDS);
			delay(30);
		}
		n++;
	}
	fill_solid(footWell, NUM_LEDS_FOOTWELL, CRGB::Blue);
	strips[2]->showLeds(gBrightness);	
}
 
Think you are right about your project settings. Just built your sketch with teensy thread blink example included and it compiled fine. Here is the result of the build process:
Code:
Board Properties
name=Teensy 3.2 / 3.1
upload.maximum_size=262144
upload.maximum_data_size=65536
upload.tool=teensyloader
upload.protocol=halfkay
build.board=TEENSY31
build.core=teensy3
build.mcu=mk20dx256
build.warn_data_percentage=97
build.toolchain=arm/bin/
build.command.gcc=arm-none-eabi-gcc
build.command.g++=arm-none-eabi-g++
build.command.ar=arm-none-eabi-gcc-ar
build.command.objcopy=arm-none-eabi-objcopy
build.command.objdump=arm-none-eabi-objdump
build.command.size=arm-none-eabi-size
build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdlib
build.flags.dep=-MMD
build.flags.optimize=-O2
build.flags.cpu=-mthumb -mcpu=cortex-m4 -fsingle-precision-constant
build.flags.defs=-D__MK20DX256__ -DTEENSYDUINO=136
build.flags.cpp=-fno-exceptions -felide-constructors -std=gnu++0x -fno-rtti
build.flags.c=
build.flags.S=-x assembler-with-cpp
build.flags.ld=-Wl,--gc-sections,--relax,--defsym=__rtc_localtime={extra.time.local} "-T{build.core.path}/mk20dx256.ld"
build.flags.libs=-larm_cortexM4l_math -lm
serial.restart_cmd=false
menu.usb.serial=Serial
menu.usb.serial.build.usbtype=USB_SERIAL
menu.usb.keyboard=Keyboard
menu.usb.keyboard.build.usbtype=USB_KEYBOARDONLY
menu.usb.keyboard.fake_serial=teensy_gateway
menu.usb.touch=Keyboard + Touch Screen
menu.usb.touch.build.usbtype=USB_TOUCHSCREEN
menu.usb.touch.fake_serial=teensy_gateway
menu.usb.hidtouch=Keyboard + Mouse + Touch Screen
menu.usb.hidtouch.build.usbtype=USB_HID_TOUCHSCREEN
menu.usb.hidtouch.fake_serial=teensy_gateway
menu.usb.hid=Keyboard + Mouse + Joystick
menu.usb.hid.build.usbtype=USB_HID
menu.usb.hid.fake_serial=teensy_gateway
menu.usb.serialhid=Serial + Keyboard + Mouse + Joystick
menu.usb.serialhid.build.usbtype=USB_SERIAL_HID
menu.usb.midi=MIDI
menu.usb.midi.build.usbtype=USB_MIDI
menu.usb.midi.fake_serial=teensy_gateway
menu.usb.serialmidi=Serial + MIDI
menu.usb.serialmidi.build.usbtype=USB_MIDI_SERIAL
menu.usb.audio=Audio
menu.usb.audio.build.usbtype=USB_AUDIO
menu.usb.audio.fake_serial=teensy_gateway
menu.usb.serialmidiaudio=Serial + MIDI + Audio
menu.usb.serialmidiaudio.build.usbtype=USB_MIDI_AUDIO_SERIAL
menu.usb.rawhid=Raw HID
menu.usb.rawhid.build.usbtype=USB_RAWHID
menu.usb.rawhid.fake_serial=teensy_gateway
menu.usb.flightsim=Flight Sim Controls
menu.usb.flightsim.build.usbtype=USB_FLIGHTSIM
menu.usb.flightsim.fake_serial=teensy_gateway
menu.usb.flightsimjoystick=Flight Sim Controls + Joystick
menu.usb.flightsimjoystick.build.usbtype=USB_FLIGHTSIM_JOYSTICK
menu.usb.flightsimjoystick.fake_serial=teensy_gateway
menu.usb.everything=All of the Above
menu.usb.everything.build.usbtype=USB_EVERYTHING
menu.usb.disable=No USB
menu.usb.disable.build.usbtype=USB_DISABLED
menu.speed.96=96 MHz (overclock)
menu.speed.72=72 MHz
menu.speed.48=48 MHz
menu.speed.24=24 MHz
menu.speed.16=16 MHz (No USB)
menu.speed.8=8 MHz (No USB)
menu.speed.4=4 MHz (No USB)
menu.speed.2=2 MHz (No USB)
menu.speed.120=120 MHz (overclock)
menu.speed.168.build.fcpu=168000000
menu.speed.144.build.fcpu=144000000
menu.speed.120.build.fcpu=120000000
menu.speed.96.build.fcpu=96000000
menu.speed.72.build.fcpu=72000000
menu.speed.48.build.fcpu=48000000
menu.speed.24.build.fcpu=24000000
menu.speed.16.build.fcpu=16000000
menu.speed.8.build.fcpu=8000000
menu.speed.4.build.fcpu=4000000
menu.speed.2.build.fcpu=2000000
menu.opt.o2std=Faster
menu.opt.o2std.build.flags.optimize=-O2
menu.opt.o2std.build.flags.ldspecs=
menu.opt.o2lto=Faster with LTO
menu.opt.o2lto.build.flags.optimize=-O2 -flto -fno-fat-lto-objects
menu.opt.o2lto.build.flags.ldspecs=-fuse-linker-plugin
menu.opt.o1std=Fast
menu.opt.o1std.build.flags.optimize=-O1
menu.opt.o1std.build.flags.ldspecs=
menu.opt.o1lto=Fast with LTO
menu.opt.o1lto.build.flags.optimize=-O1 -flto -fno-fat-lto-objects
menu.opt.o1lto.build.flags.ldspecs=-fuse-linker-plugin
menu.opt.o3std=Fastest
menu.opt.o3std.build.flags.optimize=-O3
menu.opt.o3std.build.flags.ldspecs=
menu.opt.o3lto=Fastest with LTO
menu.opt.o3lto.build.flags.optimize=-O3 -flto -fno-fat-lto-objects
menu.opt.o3lto.build.flags.ldspecs=-fuse-linker-plugin
menu.opt.ogstd=Debug
menu.opt.ogstd.build.flags.optimize=-Og
menu.opt.ogstd.build.flags.ldspecs=
menu.opt.oglto=Debug with LTO
menu.opt.oglto.build.flags.optimize=-Og -flto -fno-fat-lto-objects
menu.opt.oglto.build.flags.ldspecs=-fuse-linker-plugin
menu.opt.osstd=Smallest Code
menu.opt.osstd.build.flags.optimize=-Os --specs=nano.specs
menu.opt.osstd.build.flags.ldspecs=
menu.opt.oslto=Smallest Code with LTO
menu.opt.oslto.build.flags.optimize=-Os -flto -fno-fat-lto-objects --specs=nano.specs
menu.opt.oslto.build.flags.ldspecs=-fuse-linker-plugin
menu.keys.en-us=US English
menu.keys.en-us.build.keylayout=US_ENGLISH
menu.keys.fr-ca=Canadian French
menu.keys.fr-ca.build.keylayout=CANADIAN_FRENCH
menu.keys.xx-ca=Canadian Multilingual
menu.keys.xx-ca.build.keylayout=CANADIAN_MULTILINGUAL
menu.keys.cz-cz=Czech
menu.keys.cz-cz.build.keylayout=CZECH
menu.keys.da-da=Danish
menu.keys.da-da.build.keylayout=DANISH
menu.keys.fi-fi=Finnish
menu.keys.fi-fi.build.keylayout=FINNISH
menu.keys.fr-fr=French
menu.keys.fr-fr.build.keylayout=FRENCH
menu.keys.fr-be=French Belgian
menu.keys.fr-be.build.keylayout=FRENCH_BELGIAN
menu.keys.fr-ch=French Swiss
menu.keys.fr-ch.build.keylayout=FRENCH_SWISS
menu.keys.de-de=German
menu.keys.de-de.build.keylayout=GERMAN
menu.keys.de-dm=German (Mac)
menu.keys.de-dm.build.keylayout=GERMAN_MAC
menu.keys.de-ch=German Swiss
menu.keys.de-ch.build.keylayout=GERMAN_SWISS
menu.keys.is-is=Icelandic
menu.keys.is-is.build.keylayout=ICELANDIC
menu.keys.en-ie=Irish
menu.keys.en-ie.build.keylayout=IRISH
menu.keys.it-it=Italian
menu.keys.it-it.build.keylayout=ITALIAN
menu.keys.no-no=Norwegian
menu.keys.no-no.build.keylayout=NORWEGIAN
menu.keys.pt-pt=Portuguese
menu.keys.pt-pt.build.keylayout=PORTUGUESE
menu.keys.pt-br=Portuguese Brazilian
menu.keys.pt-br.build.keylayout=PORTUGUESE_BRAZILIAN
menu.keys.rs-rs=Serbian (Latin Only)
menu.keys.rs-rs.build.keylayout=SERBIAN_LATIN_ONLY
menu.keys.es-es=Spanish
menu.keys.es-es.build.keylayout=SPANISH
menu.keys.es-mx=Spanish Latin America
menu.keys.es-mx.build.keylayout=SPANISH_LATIN_AMERICA
menu.keys.sv-se=Swedish
menu.keys.sv-se.build.keylayout=SWEDISH
menu.keys.tr-tr=Turkish (partial)
menu.keys.tr-tr.build.keylayout=TURKISH
menu.keys.en-gb=United Kingdom
menu.keys.en-gb.build.keylayout=UNITED_KINGDOM
menu.keys.usint=US International
menu.keys.usint.build.keylayout=US_INTERNATIONAL
vid.0=0x16C0
vid.1=0x16C0
vid.2=0x16C0
vid.3=0x16C0
vid.4=0x16C0
pid.0=0x0483
pid.1=0x0487
pid.2=0x0489
pid.3=0x048A
pid.4=0x0476
runtime.ide.path=C:\Local Programs\arduino-1.8.2
runtime.os=windows
build.system.path=C:\Local Programs\arduino-1.8.2\hardware\teensy\avr\system
runtime.ide.version=10802
target_package=teensy
target_platform=teensy3
runtime.hardware.path=C:\Local Programs\arduino-1.8.2\hardware\teensy
originalid=teensy31
build.flags.ldspecs=
intellisense.include.paths.more={build.core.vmresolved}\utils;{build.core.vmresolved}\avr;{compiler.path}{build.toolchain}..\arm-none-eabi\include;
version=1.6.7
rewriting=disabled
compiler.path={runtime.hardware.path}/../tools/
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
compiler.elf2hex.flags=-O ihex -R .eeprom
recipe.preproc.includes="{compiler.path}{build.toolchain}{build.command.g++}" -M -MG -MP -x c++ -w {build.flags.cpp} {build.flags.cpu} {build.flags.defs} -DARDUINO={runtime.ide.version} -DF_CPU={build.fcpu} -D{build.usbtype} -DLAYOUT_{build.keylayout} {includes} "{source_file}"
recipe.preproc.macros="{compiler.path}{build.toolchain}{build.command.g++}" -E -CC -x c++ -w {compiler.cpp.flags} {build.flags.common} {build.flags.cpp} {build.flags.cpu} {build.flags.defs} -DARDUINO={runtime.ide.version} -DF_CPU={build.fcpu} -D{build.usbtype} -DLAYOUT_{build.keylayout} {includes} "{source_file}" -o "{preprocessed_file_path}"
recipe.cpp.o.pattern="{compiler.path}{build.toolchain}{build.command.g++}" -c {build.flags.optimize} {build.flags.common} {build.flags.dep} {build.flags.cpp} {build.flags.cpu} {build.flags.defs} -DARDUINO={runtime.ide.version} -DF_CPU={build.fcpu} -D{build.usbtype} -DLAYOUT_{build.keylayout} {includes} "{source_file}" -o "{object_file}"
recipe.c.o.pattern="{compiler.path}{build.toolchain}{build.command.gcc}" -c {build.flags.optimize} {build.flags.common} {build.flags.dep} {build.flags.c} {build.flags.cpu} {build.flags.defs} -DARDUINO={runtime.ide.version} -DF_CPU={build.fcpu} -D{build.usbtype} -DLAYOUT_{build.keylayout} {includes} "{source_file}" -o "{object_file}"
recipe.S.o.pattern="{compiler.path}{build.toolchain}{build.command.gcc}" -c {build.flags.optimize} {build.flags.common} {build.flags.dep} {build.flags.S} {build.flags.cpu} {build.flags.defs} -DARDUINO={runtime.ide.version} -DF_CPU={build.fcpu} -D{build.usbtype} -DLAYOUT_{build.keylayout} {includes} "{source_file}" -o "{object_file}"
recipe.ar.pattern="{compiler.path}{build.toolchain}{build.command.ar}" rcs "{build.path}/{archive_file}" "{object_file}"
recipe.c.combine.pattern="{compiler.path}{build.toolchain}{build.command.gcc}" {build.flags.optimize} {build.flags.ld} {build.flags.ldspecs} {build.flags.cpu} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" {build.flags.libs}
recipe.elfpatch.pattern="{compiler.path}/hardware/tools/{build.elfpatch}" -mmcu={build.mcu} "{build.path}/{build.project_name}.elf" "{sketch_path}/disk"
recipe.objcopy.eep.pattern="{compiler.path}{build.toolchain}{build.command.objcopy}" {compiler.objcopy.eep.flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep"
recipe.objcopy.hex.pattern="{compiler.path}{build.toolchain}{build.command.objcopy}" {compiler.elf2hex.flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
recipe.hooks.postbuild.1.pattern="{compiler.path}/teensy_post_compile" "-file={build.project_name}" "-path={build.path}" "-tools={compiler.path}" "-board={build.board}"
recipe.size.pattern="{compiler.path}{build.toolchain}{build.command.size}" -A "{build.path}/{build.project_name}.elf"
recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).*
recipe.size.regex.data=^(?:\.usbdescriptortable|\.dmabuffers|\.usbbuffers|\.data|\.bss|\.noinit)\s+([0-9]+).*
recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*
tools.teensyloader.cmd.path={runtime.hardware.path}/../tools
tools.teensyloader.upload.params.quiet=
tools.teensyloader.upload.params.verbose=-verbose
tools.teensyloader.upload.pattern="{cmd.path}/teensy_post_compile" -test "-file={build.project_name}" "-path={build.path}" "-tools={cmd.path}" "-board={build.board}" -reboot
recipe.output.tmp_file={build.project_name}.hex
recipe.output.save_file={build.project_name}.{build.board}.hex
recipe.output.tmp_file2={build.project_name}.elf
recipe.output.save_file2={build.project_name}.elf
vm.platform.root.path=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\rrxmpo2o.2cb\Micro Platforms\arduino16x
runtime.tools.arc-elf32.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\Intel\tools\arc-elf32\1.6.2+1.0
runtime.tools.arc-elf32-1.6.2+1.0.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\Intel\tools\arc-elf32\1.6.2+1.0
runtime.tools.arc-elf32-1.6.9+1.0.1.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\Intel\tools\arc-elf32\1.6.9+1.0.1
runtime.tools.arcxxx.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\Intel\tools\arcxxx\1.6.4+1.0
runtime.tools.arcxxx-1.6.4+1.0.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\Intel\tools\arcxxx\1.6.4+1.0
runtime.tools.arduino101load.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\Intel\tools\arduino101load\2.0.1
runtime.tools.arduino101load-2.0.1.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\Intel\tools\arduino101load\2.0.1
runtime.tools.arduinoOTA.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\arduino\tools\arduinoOTA\1.1.1
runtime.tools.arduinoOTA-1.1.1.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\arduino\tools\arduinoOTA\1.1.1
runtime.tools.arm-none-eabi-gcc.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1
runtime.tools.arm-none-eabi-gcc-4.8.3-2014q1.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1
runtime.tools.avrdude.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9
runtime.tools.avrdude-6.0.1-arduino5.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\arduino\tools\avrdude\6.0.1-arduino5
runtime.tools.avrdude-6.3.0-arduino9.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9
runtime.tools.avr-gcc.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2
runtime.tools.avr-gcc-4.8.1-arduino5.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5
runtime.tools.avr-gcc-4.9.2-atmel3.5.4-arduino2.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2
runtime.tools.bossac.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\arduino\tools\bossac\1.6.1-arduino
runtime.tools.bossac-1.6.1-arduino.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\arduino\tools\bossac\1.6.1-arduino
runtime.tools.core2-32-poky-linux.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\Intel\tools\core2-32-poky-linux\1.6.2+1.0
runtime.tools.core2-32-poky-linux-1.6.2+1.0.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\Intel\tools\core2-32-poky-linux\1.6.2+1.0
runtime.tools.dfu-util.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\arduino\tools\dfu-util\0.9.0-arduino1
runtime.tools.dfu-util-0.9.0-arduino1.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\arduino\tools\dfu-util\0.9.0-arduino1
runtime.tools.esptool.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\esp8266\tools\esptool\0.4.9
runtime.tools.esptool-0.4.9.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\esp8266\tools\esptool\0.4.9
runtime.tools.flashpack.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\Intel\tools\flashpack\2.0.0
runtime.tools.flashpack-2.0.0.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\Intel\tools\flashpack\2.0.0
runtime.tools.i586-poky-linux-uclibc.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\Intel\tools\i586-poky-linux-uclibc\1.6.2+1.0
runtime.tools.i586-poky-linux-uclibc-1.6.2+1.0.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\Intel\tools\i586-poky-linux-uclibc\1.6.2+1.0
runtime.tools.mkspiffs.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\esp8266\tools\mkspiffs\0.1.2
runtime.tools.mkspiffs-0.1.2.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\esp8266\tools\mkspiffs\0.1.2
runtime.tools.openocd.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\Intel\tools\openocd\0.9.0+0.1
runtime.tools.openocd-0.9.0+0.1.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\Intel\tools\openocd\0.9.0+0.1
runtime.tools.sketchUploader.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\Intel\tools\sketchUploader\1.6.2+1.0
runtime.tools.sketchUploader-1.6.2+1.0.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\Intel\tools\sketchUploader\1.6.2+1.0
runtime.tools.xtensa-lx106-elf-gcc.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2
runtime.tools.xtensa-lx106-elf-gcc-1.20.0-26-gb404fb9-2.path=C:\Users\CyberPalin\AppData\Local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2
runtime.vm.boardinfo.id=teensy31
runtime.vm.boardinfo.name=teensy31
runtime.vm.boardinfo.desc=Teensy 3.2 / 3.1
runtime.vm.boardinfo.src_location=C:\Local Programs\arduino-1.8.2\hardware\teensy\avr
ide.hint=Use installed IDE. Provides built-in hardware, reference/help and libraries.
ide.location.key=Arduino16x
ide.location.ide.winreg=Arduino 1.6.x Application
ide.location.sketchbook.winreg=Arduino 1.6.x Sketchbook
ide.location.sketchbook.preferences=sketchbook.path
ide.default.revision_name=1.8.0
ide.default.version=10800
ide.default.package=arduino
ide.default.platform=avr
ide.multiplatform=true
ide.includes=arduino.h
ide.exe_name=arduino
ide.platformswithoutpackage=false
ide.includes.fallback=wprogram.h
ide.extension=ino
ide.extension.fallback=pde
ide.versionGTEQ=160
ide.exe=arduino.exe
ide.hosts=atmel
ide.url=http://arduino.cc/en/Main/Software
ide.help.reference.path=reference
ide.help.reference.path2=reference\www.arduino.cc\en\Reference
ide.help.reference.serial=reference\www.arduino.cc\en\Serial
vm.debug=true
software=ARDUINO
ssh.user.name=root
ssh.user.default.password=arduino
ssh.host.wwwfiles.path=/www/sd
build.working_directory={runtime.ide.path}\java\bin
ide.location.preferences.portable={runtime.ide.path}\portable
ide.location.preferences.arduinoData={runtime.sketchbook.path}\ArduinoData
ide.location.preferences=%VM_APPDATA_LOCAL%\arduino15\preferences.txt
ide.location.preferences_fallback=%VM_APPDATA_ROAMING%\arduino15\preferences.txt
ide.location.contributions=%VM_APPDATA_LOCAL%\arduino15
ide.location.contributions_fallback=%VM_APPDATA_ROAMING%\arduino15
ide.contributions.boards.allow=true
ide.contributions.boards.ignore_unless_rewrite_found=true
ide.contributions.libraries.allow=true
ide.contributions.boards.support.urls.wiki=https://github.com/arduino/Arduino/wiki/Unofficial-list-of-3rd-party-boards-support-urls
ide.create_platforms_from_boardsTXT.teensy=build.core
ide.appid=arduino16x
location.sketchbook=C:\Users\CyberPalin\Documents\Arduino
build.core.path=C:\Local Programs\arduino-1.8.2\hardware\teensy\avr\cores\teensy3
vm.core.include=arduino.h
vm.boardsource.path=C:\Local Programs\arduino-1.8.2\hardware\teensy\avr
runtime.platform.path=C:\Local Programs\arduino-1.8.2\hardware\teensy\avr
vm.platformname.name=teensy3
build.arch=TEENSY3
build.usbtype=USB_SERIAL
build.fcpu=96000000
build.keylayout=US_ENGLISH
builder.noino=false
build.architecture=hardware
vmresolved.compiler.path=C:\Local Programs\arduino-1.8.2\hardware\tools\
vmresolved.tools.path=C:\Local Programs\arduino-1.8.2\hardware
build.path=C:\Users\CyberPalin\AppData\Local\Temp\VMBuilds\testForThreadLed\teensy31\Debug
build.project_name=testForThreadLed.ino
build.project_path=C:\Users\CyberPalin\Documents\Arduino\testForThreadLed
ProjectDir=C:\Users\CyberPalin\Documents\Arduino\testForThreadLed\
vm.runtime.compiler.showwarnings=false
vm.runtime.upload.verbose=false
vm.runtime.upload.verify=false
vm.runtime.compiler.auto_discover_includes=true
vm.runtime.compiler.auto_discover_includes_cache=true
build.vm.build.vmdebug=0
build.vm.build.isgdb=0
build.vm.build.optimised=1
vm.last.buildpath=C:\Users\CyberPalin\AppData\Local\Temp\VMBuilds\testForThreadLed\teensy31\Debug

Visual Micro free version. CTRL+click for secure purchase http://www.visualmicro.com/page/shop.aspx

Compiling 'testForThreadLed' for 'Teensy 3.2 / 3.1'
 
testForThreadLed.ino: In file included from
FastLED.h:17: note  #pragma message  FastLED version 3.001.005
   #    pragma message "FastLED version 3.001.005"
Program size: 29,536 bytes (used 11% of a 262,144 byte maximum) (24.34 secs)
Minimum Memory Usage: 5788 bytes (9% of a 65536 byte maximum)

It also built fine in the Arduino ide. You might want to start with a fresh project and copy your code into it and give it a try.

Mike
 
Possibly time to give up.

Just tried in a clean location in the Arduino IDE:
Code:
In file included from Z:\Arduino_1_8_0\Sketches\TouchTest\TouchTest.ino:7:0:

Z:\Arduino_1_8_0\Sketches\libraries\FastLED/FastLED.h:558:2: warning: #warning "No pin/port mappings found, pin access will be slightly slower. See fastpin.h for info." [-Wcpp]

 #warning "No pin/port mappings found, pin access will be slightly slower. See fastpin.h for info."

  ^

In file included from Z:\Arduino_1_8_0\Sketches\TouchTest\TouchTest.ino:7:0:

Z:\Arduino_1_8_0\Sketches\libraries\FastLED/FastLED.h:17:21: note: #pragma message: FastLED version 3.001.003

 #    pragma message "FastLED version 3.001.003"

                     ^

In file included from Z:\Arduino_1_8_0\Sketches\TouchTest\TouchTest.ino:6:0:

Z:\Arduino_1_8_0\Sketches\libraries\FastLED/colorutils.h: In constructor 'CHSVPalette16::CHSVPalette16(const uint32_t (&)[16])':

E:\arduino-1.8.2-windows\arduino-1.8.2\hardware\teensy\avr\libraries\TeensyThreads/TeensyThreads.h:321:19: error: declaration does not declare anything [-fpermissive]

 #define typeof(a) decltype(a);

                   ^

E:\arduino-1.8.2-windows\arduino-1.8.2\hardware\teensy\avr\cores\teensy3/avr/pgmspace.h:106:2: note: in expansion of macro 'typeof'

  typeof(addr) _addr = (addr); \

  ^

E:\arduino-1.8.2-windows\arduino-1.8.2\hardware\teensy\avr\cores\teensy3/avr/pgmspace.h:118:35: note: in expansion of macro 'pgm_read_dword'

 #define pgm_read_dword_near(addr) pgm_read_dword(addr)

Maybe It's just not my week. Shelve this and work on something else. Or start from scratch. with a completely new project and new functions.

Appreciate the effort though for sure. Not sure what's going wrong with my machine.
 
I got something about pin_mappings until I doubled checked the selected board, had 3.5 selected instead of 3.2. selected.

PS. Not sure what ide version you are running but from above your files are in 1.8.0. Don't know if this matters but from the Teensyduino download page it says 1.36 is supports IDE 1.8.1 and 1.8.2. IDE 1.8.0 is not listed so don't know if this matters if you are trying to compile with the IDE.
 
Last edited:
Took some time this morning to sort it out. It's working now.

Code:
#include <stdint.h>
//#include <utility>

That's all it needed. The inclusion of that extra header broke it all.

Removed utility and everything works perfectly.

Again, I greatly appreciate all the input here.
 
Fernando,

Have you given any more thought to refactoring the library to use a linked list?

I've started some preliminary data structures for the linked list, and I wouldn't mind helping out where I can with this.
 
Fernando,

Have you given any more thought to refactoring the library to use a linked list?

I've started some preliminary data structures for the linked list, and I wouldn't mind helping out where I can with this.

Are you referring to the structure that holds the thread info that is now just a fixed-length array? Or something else?

If there is demand for more than 10 simultaneous threads, then it might be worth the trouble. I'm curious why you need more than 10 threads? Otherwise, it just makes things more complicated and may even slow down some tasks.
 
Are you referring to the structure that holds the thread info that is now just a fixed-length array? Or something else?

If there is demand for more than 10 simultaneous threads, then it might be worth the trouble. I'm curious why you need more than 10 threads? Otherwise, it just makes things more complicated and may even slow down some tasks.

There was mention in the code of making the thread pool more dynamic. The static allocation of 8 threads when really only 3 are necessary seems a bit overkill. I assumed since the comments were made at the code-level that there was a refactoring to a linked list, it was something that was intended, just never implemented.

Code:
  /*
   * The maximum number of threads is hard-coded. Alternatively, we could implement
   * a linked list which would mean using up less memory for a small number of
   * threads while allowing an unlimited number of possible threads. This would
   * probably not slow down thread switching too much, but it would introduce
   * complexity and possibly bugs. So to simplifiy for now, we use an array.
   * But in the future, a linked list might be more appropriate.
   */
  ThreadInfo thread[MAX_THREADS];
 
Back
Top