Subversion Repositories HomeAutomation

Rev

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

Rev 2065 Rev 2119
Line 1042... Line 1042...
1042
    uint64_t tempshift = proto->data;
1042
    uint64_t tempshift = proto->data;
1043
 
1043
 
1044
    /* No dimming */
1044
    /* No dimming */
1045
    *len = 131;
1045
    *len = 131;
1046
    uint8_t dimming = 0;
1046
    uint8_t dimming = 0;
1047
   
-
 
1048
    /* If most significant bit is set, then dimming should be sent */
1047
    /* If most significant bit is set, then dimming should be sent */
1049
    if (tempshift&(1ULL<<47))
1048
    if ((uint32_t)(tempshift>> 32)&0x80)
1050
    {
1049
    {
1051
        /* Dimming */
1050
        /* Dimming */
1052
        *len = 147;
1051
        *len = 147;
1053
        dimming=1;
1052
        dimming=1;
1054
    }
1053
    }
1055
   
1054
   
1056
    for (uint8_t i = 2; i < *len; i+=4)
1055
    for (uint8_t i = 2; i < *len; i+=4)
1057
    {
1056
    {
1058
        buf[i] = IR_NEXA2_HIGH;
1057
        buf[i] = IR_NEXA2_HIGH;
1059
        buf[i+2] = IR_NEXA2_HIGH;
1058
        buf[i+2] = IR_NEXA2_HIGH;
1060
        if (tempshift&1) {
1059
        if (tempshift&1) {
Line 1063... Line 1062...
1063
        } else {
1062
        } else {
1064
            buf[i+1] = IR_NEXA2_LOW_ZERO;
1063
            buf[i+1] = IR_NEXA2_LOW_ZERO;
1065
            buf[i+3] = IR_NEXA2_LOW_ONE;
1064
            buf[i+3] = IR_NEXA2_LOW_ONE;
1066
        }
1065
        }
1067
        tempshift = tempshift>>1;
1066
        tempshift = tempshift>>1;
1068
    }
1067
    }
1069
   
1068
   
1070
    if (dimming)
1069
    if (dimming)
1071
    {
1070
    {
1072
        //TODO: verify below bit numbers
-
 
1073
        buf[111] = IR_NEXA2_LOW_ONE;
1071
        buf[111] = IR_NEXA2_LOW_ONE;
1074
        buf[113] = IR_NEXA2_LOW_ONE;
1072
        buf[113] = IR_NEXA2_LOW_ONE;
1075
    }
1073
    }
1076
   
-
 
1077
    proto->modfreq=IR_NEXA2_F_MOD;
1074
    proto->modfreq=IR_NEXA2_F_MOD;
1078
    proto->timeout=IR_NEXA2_START1/1000;
1075
    proto->timeout=IR_NEXA2_START1/1000;
1079
    proto->repeats=IR_NEXA2_REPS;
1076
    proto->repeats=IR_NEXA2_REPS;
1080
    return IR_OK;
1077
    return IR_OK;
1081
}
1078
}