diff 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
line wrap: on
line diff
--- a/src/cs/drivers/drv_app/ffs/board/drv.c	Fri Jul 20 01:09:12 2018 +0000
+++ b/src/cs/drivers/drv_app/ffs/board/drv.c	Fri Jul 20 02:48:06 2018 +0000
@@ -1287,7 +1287,12 @@
                                           sizeof(detect_code));
         // Combine bit 0 of the thumb mode function pointer with the address
         // of the code in RAM. Then call the detect function in RAM.
+#ifdef __GNUC__
+        /* gcc fails to do the needed trick, so force Thumb */
+        myfp = (pf_t) (((int) detect_code) | 1);
+#else
         myfp = (pf_t) (((int) &ffsdrv_device_id_read & 1) | (int) detect_code);
+#endif
         (*myfp)(&dev.manufact, device_id);
 
         if ((dev.manufact == MANUFACT_AMD || dev.manufact == MANUFACT_FUJITSU) &&