Example #1
0
// stuff to do on idle
void jshIdle() {
  if (init == 1)
  {
    jsiOneSecondAfterStartup(); // Do this the first time we enter jshIdle() after we have called jshInit() and never again.
    init = 0;
  }

  jshUSARTKick(EV_SERIAL1);
}
Example #2
0
void jshIdle() {
  // hack in order to get console device set correctly
  static bool inited = false;
  if (!inited) {
    inited = true;
    jsiOneSecondAfterStartup();
  }

  while (Serial.available() > 0) {
    jshPushIOCharEvent(EV_SERIAL1, Serial.read());
  }
}
Example #3
0
void jshIdle() {
  // hack in order to get console device set correctly
  static bool inited = false;
  if (!inited) {
    inited = true;
    jsiOneSecondAfterStartup();
  }

  /*static bool foo = false;
  foo = !foo;
  jshPinSetValue(LED1_PININDEX, foo);*/

  while (serial_readable(&mbedSerial[0])>0)
        jshPushIOCharEvent(EV_SERIAL1, serial_getc(&mbedSerial[0]));
}