patchAVR C Runtime Library - Patches: patch #3925, Dallas iButton 8-bit CRC

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #3925: Dallas iButton 8-bit CRC

Submitter:  None
Submitted:  Wed 20 Apr 2005 09:32:23 PM UTC
   
 
Category:  None Priority:  2
Status:  Done Privacy:  Public
Assigned to:  joerg_wunsch Originator Email:  -email is unavailable-
Open/Closed:  Closed

Mon 14 Nov 2005 10:55:32 PM UTC, comment #1: 

Implemented as inline asm.

Joerg Wunsch <joerg_wunsch>
Group administrator
Wed 20 Apr 2005 09:32:23 PM UTC, original submission:  

I couldn't find this when I went looking for it. So I modified the example in the crc_xmodem_update function, to come up with the following code. This saved me 252 bytes vs. a lookup table. I don't know if this CRC is too specific to this application to be included in this project or not, but here it is anyways. Maybe it will help someone.

uint8_t crc_ibutton_update (uint8_t crc, uint8_t data)
{
        char i;

        crc = crc ^ data;
        for (i=0; i<8; i++)
        {
                if (crc & 0x01)
                        crc = (crc >> 1) ^ 0x8C;
                else
                        crc >>= 1;
        }

        return crc;
}

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-11-14 joerg_wunsch StatusNone Done
    Assigned toNone joerg_wunsch
    Open/ClosedOpen Closed

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code