Subversion Repositories HomeAutomation

Rev

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

Rev 1018 Rev 1790
Line 154... Line 154...
154
    BIOS_CanSend(&txMsg);
154
    BIOS_CanSend(&txMsg);
155
   
155
   
156
   
156
   
157
   
157
   
158
   
158
   
159
    //Initiera utgŒngar
159
    //Initiera utg\8Cngar
160
    DDRB |= (1<<7)|(1<<2)|(1<<1)|(1<<0);
160
    DDRB |= (1<<7)|(1<<2)|(1<<1)|(1<<0);
161
    DDRC |= (1<<5)|(1<<4);  
161
    DDRC |= (1<<5)|(1<<4);  
162
    DDRD |= (1<<7)|(1<<6)|(1<<5)|(1<<4)|(1<<2)|(1<<1)|(1<<0);
162
    DDRD |= (1<<7)|(1<<6)|(1<<5)|(1<<4)|(1<<2)|(1<<1)|(1<<0);
163
    glcdPowerOn();
163
    glcdInit();
164
 
164
 
165
    glcdSetXY(0,0);
165
    glcdSetXY(0,0);
166
    glcdSetXY(0,0);
166
    glcdSetXY(0,0);
167
    glcdSetXY(0,0);
167
    glcdSetXY(0,0);
168
 
168
 
Line 192... Line 192...
192
 
192
 
193
       
193
       
194
        if (rxMsgFull) {
194
        if (rxMsgFull) {
195
            uint16_t sns_type;
195
            uint16_t sns_type;
196
            uint8_t snsid;
196
            uint8_t snsid;
197
            if ( ((rxMsg.Id & CAN_MASK_CLASS)>>CAN_SHIFT_CLASS) == CAN_SNS){// FIXME ett jŠkla herk, stŠda upp
197
            if ( ((rxMsg.Id & CAN_MASK_CLASS)>>CAN_SHIFT_CLASS) == CAN_SNS){// FIXME ett j\8Akla herk, st\8Ada upp
198
           
198
           
199
                sns_type = (uint16_t)((rxMsg.Id & CAN_MASK_SNS_TYPE) >> CAN_SHIFT_SNS_TYPE);
199
                sns_type = (uint16_t)((rxMsg.Id & CAN_MASK_SNS_TYPE) >> CAN_SHIFT_SNS_TYPE);
200
                snsid = (uint8_t)((rxMsg.Id & CAN_MASK_SNS_ID) >> CAN_SHIFT_SNS_ID);
200
                snsid = (uint8_t)((rxMsg.Id & CAN_MASK_SNS_ID) >> CAN_SHIFT_SNS_ID);
201
               
201
               
202
                switch(sns_type)
202
                switch(sns_type)
Line 242... Line 242...
242
    }
242
    }
243
   
243
   
244
    return 0;
244
    return 0;
245
}
245
}
246
 
246
 
247
    //‡ la pengi. Skall libbifieras.
247
    //\87 la pengi. Skall libbifieras.
248
    void numtoascii( int16_t num, char **str ) {
248
    void numtoascii( int16_t num, char **str ) {
249
        if( num==0 ) return;
249
        if( num==0 ) return;
250
        numtoascii( num/10, str );
250
        numtoascii( num/10, str );
251
        **str = '0' + (num%10);
251
        **str = '0' + (num%10);
252
        (*str)++;
252
        (*str)++;