Exemplo n.º 1
0
  /**
   * Dispatch an interrupt to the handler according to the core and the interrupt number. Interrupt
   * 0 is the scheduler.
   */
  static void interrupt() {

    // the clean way
    // ih[sys.cpuId][sys.intNr].run();
    // a little bit faster
    ih[Native.rd(Const.IO_CPU_ID)][Native.rd(Const.IO_INTNR)].run();
    // Enable interrupts again - we could have invoked a dummy handler
    Native.wr(1, Const.IO_INT_ENA);
    //		wr('!');
    //		wr('0'+nr);
  }
Exemplo n.º 2
0
  public static void wr(int c) {

    // busy wait on free tx buffer
    // but ncts is not used anymore =>
    // no wait on an open serial line, just wait
    // on the baud rate
    while ((Native.rd(Const.IO_STATUS) & 1) == 0) {;
    }
    Native.wr(c, Const.IO_UART);
    // this is the USB port
    /* we will NOT wait for the USB device to be compatible
       with other configurations. The UART limits the transfer rate
       to about 10kB/s.

    // while ((Native.rdMem(Const.IO_USB_STATUS) & Const.MSK_UA_TDRE)==0) {
    	;
    }
    */
    // disable for OEBB project
    Native.wrMem(c, Const.IO_USB_DATA);
  }
Exemplo n.º 3
0
 /**
  * Sets speaker output.
  *
  * @param value Valid input range is 0..0xff.
  */
 public static final void write(int value) {
   Native.wr(value, IO_SPEAKER);
 }
Exemplo n.º 4
0
 /** Sets speaker output. */
 public static final void write(boolean value) {
   Native.wr(value ? MAX_VALUE : 0, IO_SPEAKER);
 }
Exemplo n.º 5
0
 /**
  * Writes the corresponding bits to the unused pins IN0-IN9 of the PLD. Pins configured as input
  * are unaffected.
  */
 public static void writePins(int value) {
   Native.wr(value, IO_FUTUREUSE);
 }