Ero sivun ”Kulmapaikka:Ajankohtaista” versioiden välillä

Kulmapaikasta
Siirry navigaatioon Siirry hakuun
pEi muokkausyhteenvetoa
pEi muokkausyhteenvetoa
Rivi 9: Rivi 9:
phpinfo();
phpinfo();
phpinfo();
phpinfo();
</code>
<code c n>
#include <avr/io.h>
#include <avr/wdt.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <util/delay.h>
#include "buffer.h"
#include "hw.h"
#include "main.h"
#include "usbdrv/usbdrv.h"
buf_t m324_tx_buffer;
uint16_t bytes_remaining = 0;
usbMsgLen_t usbFunctionSetup(uchar data[8])
{
        usbRequest_t *rq = (void *)data;
        switch(rq->bRequest)
        { 
                case CUSTOM_RQ_WRITE_DATA:
                        bytes_remaining = rq->wLength.word;
                        if(bytes_remaining > buf_free(&m324_tx_buffer))
                                bytes_remaining = buf_free(&m324_tx_buffer);
                        return USB_NO_MSG;      // Tell the driver to use usbFunctionWrite()
                case CUSTOM_RQ_POWER_ON:
                        POWER_ON();
                        break;
                case CUSTOM_RQ_POWER_OFF:
                        POWER_OFF();
                        break;
                default:
                        break;
        }                 
        return 0;      /* default for not implemented requests: return no data back to host */
}
</code>
</code>

Versio 5. heinäkuuta 2012 kello 15.02

TODO

  • Steam-tilastot
  • RSS-aggregoija
  • Pelipalvelin status

phpinfo(); phpinfo(); phpinfo(); phpinfo();


  1. include <avr/io.h>
  2. include <avr/wdt.h>
  3. include <avr/interrupt.h>
  4. include <avr/pgmspace.h>
  5. include <util/delay.h>
  6. include "buffer.h"
  7. include "hw.h"
  8. include "main.h"
  9. include "usbdrv/usbdrv.h"


buf_t m324_tx_buffer; uint16_t bytes_remaining = 0;


usbMsgLen_t usbFunctionSetup(uchar data[8]) {

       usbRequest_t *rq = (void *)data;
       switch(rq->bRequest)
       {   
               case CUSTOM_RQ_WRITE_DATA:
                       bytes_remaining = rq->wLength.word;
                       if(bytes_remaining > buf_free(&m324_tx_buffer))
                               bytes_remaining = buf_free(&m324_tx_buffer);
                       return USB_NO_MSG;      // Tell the driver to use usbFunctionWrite()
               case CUSTOM_RQ_POWER_ON:
                       POWER_ON();
                       break;
               case CUSTOM_RQ_POWER_OFF:
                       POWER_OFF();
                       break;
               default:
                       break;
       }                   
       return 0;       /* default for not implemented requests: return no data back to host */

}