Changeset 2f4b3a4 in mainline
- Timestamp:
- 2011-04-01T11:50:15Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ad7bb42
- Parents:
- d012590
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/hidparser.c
rd012590 r2f4b3a4 1239 1239 } 1240 1240 1241 size_t shift=0; 1242 if(((offset+length)%8) > 0) { 1243 shift = (8- ((offset+length)%8)); 1244 } 1241 size_t shift = offset%8; 1245 1242 1246 1243 value = value << shift; … … 1251 1248 // je to ve dvou!! FIXME: melo by to umet delsi jak 2 1252 1249 1253 // konec prvniho 1250 // konec prvniho -- dolni x bitu 1254 1251 tmp_value = value; 1255 tmp_value = tmp_value >> (8 - (offset%8) - 1);1256 1252 tmp_value = tmp_value & ((1 << (8-(offset%8)))-1); 1253 tmp_value = tmp_value << (offset%8); 1257 1254 1258 1255 buffer[offset/8] = buffer[offset/8] | tmp_value; 1259 1256 1260 // a ted druhej 1261 value = value & ((1 << (length - (8 - (offset%8))))-1);1262 value = value << (8 - (length - (8 - (offset%8))));1257 // a ted druhej -- hornich length-x bitu 1258 value = value >> (8 - (offset % 8)); 1259 value = value & ((1 << (length - (8 - (offset % 8)))) - 1); 1263 1260 1264 1261 buffer[(offset+length-1)/8] = buffer[(offset+length-1)/8] | value;
Note:
See TracChangeset
for help on using the changeset viewer.