Subversion Repositories HomeAutomation

Rev

Rev 53 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 53 Rev 56
Line 135... Line 135...
135
    uartPutc((BYTE)(cm.ident));
135
    uartPutc((BYTE)(cm.ident));
136
    uartPutc((BYTE)(cm.ident>>8));
136
    uartPutc((BYTE)(cm.ident>>8));
137
    uartPutc((BYTE)(cm.ident>>16));
137
    uartPutc((BYTE)(cm.ident>>16));
138
    uartPutc((BYTE)(cm.ident>>24));
138
    uartPutc((BYTE)(cm.ident>>24));
139
    uartPutc(cm.extended);
139
    uartPutc(cm.extended);
-
 
140
    uartPutc(cm.remote_request);
140
    uartPutc(cm.data_length);
141
    uartPutc(cm.data_length);
141
    for(i=0;i<8;i++) uartPutc(cm.data[i]);
142
    for(i=0;i<8;i++) uartPutc(cm.data[i]);
142
    uartPutc(UART_END_BYTE);
143
    uartPutc(UART_END_BYTE);
143
 
144
 
144
}
145
}
Line 173... Line 174...
173
 
174
 
174
    if (waitingMessage==TRUE)
175
    if (waitingMessage==TRUE)
175
    {
176
    {
176
 
177
 
177
        timeout=tickGet();
178
        timeout=tickGet();
-
 
179
 
178
 
180
 
179
        // UART END
181
        // UART END
180
        if(count>=14)
182
        if(count>=15)
181
        {
183
        {
182
            if (c==UART_END_BYTE)
184
            if (c==UART_END_BYTE)
183
            {
185
            {
-
 
186
                LED0_IO=~LED0_IO;
184
                while(!canSendMessage(cm));
187
                while(!canSendMessage(cm,PRIO_LOWEST));
185
            }
188
            }
186
            waitingMessage=FALSE;
189
            waitingMessage=FALSE;
187
            return;
190
            return;
188
        }
191
        }
189
 
192
 
190
        // data
193
        // data
-
 
194
        if(count>=7)
-
 
195
        {
-
 
196
            cm.data[count-7]=c;
-
 
197
            count++;
-
 
198
            return;
-
 
199
        }
-
 
200
 
-
 
201
        // data length
191
        if(count>=6)
202
        if(count>=6)
192
        {
203
        {
193
            cm.data[count-6]=c;
204
            cm.data_length=c;
194
            count++;
205
            count++;
195
            return;
206
            return;
196
        }
207
        }
197
 
208
 
198
        // data length
209
        // remote request
199
        if(count>=5)
210
        if(count>=5)
200
        {
211
        {
201
            cm.data_length=c;
212
            cm.remote_request=c;
202
            count++;
213
            count++;
203
            return;
214
            return;
204
        }
215
        }
205
 
216
 
206
        // extended
217
        // extended