Subversion Repositories HomeAutomation

Rev

Rev 1755 | Rev 1841 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1755 Rev 1828
Line 385... Line 385...
385
        drvIrTxChannel[channel].enable = TRUE;
385
        drvIrTxChannel[channel].enable = TRUE;
386
        drvIrTxChannel[channel].timeoutEnable = FALSE;
386
        drvIrTxChannel[channel].timeoutEnable = FALSE;
387
    }
387
    }
388
}
388
}
389
 
389
 
390
void IrTransceiver_Transmit(uint8_t channel, uint16_t *buffer, uint8_t length)
390
void IrTransceiver_Transmit(uint8_t channel, uint16_t *buffer, uint8_t start, uint8_t length)
391
{
391
{
392
    uint16_t diff;
392
    uint16_t diff;
393
    uint8_t findchannel;
393
    uint8_t findchannel;
394
 
394
 
395
    if (length > 0)
395
    if (length > start)
396
    {
396
    {
397
        if (drvIrTxChannel[channel].timeoutEnable == FALSE)
397
        if (drvIrTxChannel[channel].timeoutEnable == FALSE)
398
        {
398
        {
399
            drvIrTxChannel[channel].timeoutEnable = TRUE;
399
            drvIrTxChannel[channel].timeoutEnable = TRUE;
400
            drvIrTxChannel[channel].txbuf = buffer;
400
            drvIrTxChannel[channel].txbuf = buffer;
401
            drvIrTxChannel[channel].txlen = length;
401
            drvIrTxChannel[channel].txlen = start+length;
402
            /* first value will be loaded directly to timer below, therefore index is set to 1 here */
402
            /* first value will be loaded directly to timer below, therefore index is set to 1 here */
403
            drvIrTxChannel[channel].txindex = 1;
403
            drvIrTxChannel[channel].txindex = 1+start;
404
            drvIrTxChannel[channel].timeout = IR_COUNT_REG + drvIrTxChannel[channel].txbuf[0];
404
            drvIrTxChannel[channel].timeout = IR_COUNT_REG + drvIrTxChannel[channel].txbuf[start];
405
 
405
 
406
 
406
 
407
            findchannel = 0;
407
            findchannel = 0;
408
            diff = 0xffff;
408
            diff = 0xffff;
409
            uint16_t time = IR_COMPARE_REG;
409
            uint16_t time = IR_COMPARE_REG;