Changeset f401312 in mainline for uspace/drv/usbhub/utils.c


Ignore:
Timestamp:
2011-01-14T12:34:42Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
45019865
Parents:
b2a6fcfe (diff), 6610565b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merged development into lelian/hidd

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhub/utils.c

    rb2a6fcfe rf401312  
    200200
    201201
    202 /*
    203  * method for testing port status bitmap
    204  
    205 static void usb_hub_test_port_status(void) {
    206         printf("[usb_hub] -------------port status test---------\n");
    207         usb_port_status_t status = 0;
    208 
    209         //printf("original status %d (should be 0)\n",(uint32_t)status);
    210         usb_port_set_bit(&status, 1, 1);
    211         //printf("%d =?= 2\n",(uint32_t)status);
    212         if (status != 2) {
    213                 printf("[usb_port_status] test failed: wrong set of bit 1\n");
    214                 return;
    215         }
    216         usb_port_set_bit(&status, 3, 1);
    217         if (status != 10) {
    218                 printf("[usb_port_status] test failed: wrong set of bit 3\n");
    219                 return;
    220         }
    221 
    222         usb_port_set_bit(&status, 15, 1);
    223         if (status != 10 + (1 << 15)) {
    224                 printf("[usb_port_status] test failed: wrong set of bit 15\n");
    225                 return;
    226         }
    227         usb_port_set_bit(&status, 1, 0);
    228         if (status != 8 + (1 << 15)) {
    229                 printf("[usb_port_status] test failed: wrong unset of bit 1\n");
    230                 return;
    231         }
    232         int i;
    233         for (i = 0; i < 32; ++i) {
    234                 if (i == 3 || i == 15) {
    235                         if (!usb_port_get_bit(&status, i)) {
    236                                 printf("[usb_port_status] test failed: wrong bit at %d\n", i);
    237                         }
    238                 } else {
    239                         if (usb_port_get_bit(&status, i)) {
    240                                 printf("[usb_port_status] test failed: wrong bit at %d\n", i);
    241                         }
    242                 }
    243         }
    244 
    245         printf("test ok\n");
    246 
    247 
    248         //printf("%d =?= 10\n",(uint32_t)status);
    249 
    250         //printf("this should be 0: %d \n",usb_port_get_bit(&status,0));
    251         //printf("this should be 1: %d \n",usb_port_get_bit(&status,1));
    252         //printf("this should be 0: %d \n",usb_port_get_bit(&status,2));
    253         //printf("this should be 1: %d \n",usb_port_get_bit(&status,3));
    254         //printf("this should be 0: %d \n",usb_port_get_bit(&status,4));
    255 
    256 }
    257 */
     202
    258203
    259204
Note: See TracChangeset for help on using the changeset viewer.