comparison src/cs/drivers/drv_app/ffs/board/drv.c @ 71:8019491a67a9

.../drv_app/ffs/board/drv.c: gcc has trouble with Thumb bit voodoo
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 20 Jul 2018 02:48:06 +0000
parents 559a8b3ef10b
children 4484ab3f6ab3
comparison
equal deleted inserted replaced
70:1fb5f04c57d4 71:8019491a67a9
1285 1285
1286 ffsdrv_device_id_read_copy_to_ram((uint16 *) detect_code, 1286 ffsdrv_device_id_read_copy_to_ram((uint16 *) detect_code,
1287 sizeof(detect_code)); 1287 sizeof(detect_code));
1288 // Combine bit 0 of the thumb mode function pointer with the address 1288 // Combine bit 0 of the thumb mode function pointer with the address
1289 // of the code in RAM. Then call the detect function in RAM. 1289 // of the code in RAM. Then call the detect function in RAM.
1290 #ifdef __GNUC__
1291 /* gcc fails to do the needed trick, so force Thumb */
1292 myfp = (pf_t) (((int) detect_code) | 1);
1293 #else
1290 myfp = (pf_t) (((int) &ffsdrv_device_id_read & 1) | (int) detect_code); 1294 myfp = (pf_t) (((int) &ffsdrv_device_id_read & 1) | (int) detect_code);
1295 #endif
1291 (*myfp)(&dev.manufact, device_id); 1296 (*myfp)(&dev.manufact, device_id);
1292 1297
1293 if ((dev.manufact == MANUFACT_AMD || dev.manufact == MANUFACT_FUJITSU) && 1298 if ((dev.manufact == MANUFACT_AMD || dev.manufact == MANUFACT_FUJITSU) &&
1294 device_id[0] == 0x227E) { 1299 device_id[0] == 0x227E) {
1295 // This is a multi-id device 1300 // This is a multi-id device