Code: Select all
#include "ch.hpp"
using namespace chibios_rt;
class test_thread : public BaseThread
{
public:
test_thread(void)
{
x = 0;
}
virtual void main(void)
{
while(1)
{
chThdSleepMilliseconds(500);
++x;
}
}
void set_x(int xx)
{
x = xx;
}
private:
volatile int x;
};
test_thread test1;
volatile int y;
int main(void)
{
System::init();
test1.set_x(5);
test1.start(9);
while(1)
{
++y;
}
}
test_thread functions that I don't explicitly call ( like the constructor or main ) don't get compiled in. Functions like set_x that I explicitly call work correctly.
Anyone run into this?