iliasam / OpenTOFLidar

Open Source TOF Lidar
https://habr.com/ru/post/485574/
MIT License
752 stars 185 forks source link

Compilation Error on IAR 8.40.1 #3

Closed AbidHussain70 closed 4 years ago

AbidHussain70 commented 4 years ago

I am using encoder disc with 100 slits in it instead of 65 slits you used. I could not found encoder disc with 65 slits. So I changed the parameter "ENCODER_HOLES_CNT" to 100 (reference is attached below) and tried recompiling the code in the latest IAR IDE but it gives the following error during compilation.

https://github.com/iliasam/OpenTOFLidar/blob/d2ed102225cc642949f4d09c30fa0e5a3a8fc32a/Firmware/scanning_fw/config.h#L185

Here is the screen-shot of the error

Capture09

When I open your project files, the IAR software ports the old project file to an updated project file in the new version. Is the error because of this? If so what version you used for the successfully compilation?

iliasam commented 4 years ago

Yes, this problem is caused by IAR version. I'm using IAR 7.50.

Try to add this code after "#include "stm32f30x.h"" in main.h:

if defined ( ICCARM ) // IAR

include "intrinsics.h"

endif

AbidHussain70 commented 4 years ago

I tired this but I was getting the same error.

Then I remove the if statement and it works.

include "stm32f30x.h"" in main.h:

//#if defined ( ICCARM ) // IAR

include "intrinsics.h"

//#endif

Thanks

iliasam commented 4 years ago

I'm sorry, there was a problem in Github message parser. The code should be: #if defined(__ICCARM__) // IAR #include "intrinsics.h" #endif Does it work?

AbidHussain70 commented 4 years ago

Ohhh, no need to say sorry.

First I tried the given command **#if defined(ICCARM) // IAR

include "intrinsics.h"

endif**

But it was giving the same error. Then I removed the if statement and it works. I simply add the following line. #include "intrinsics.h"

iliasam commented 4 years ago

The will no be "intrinsics.h" in Keil. I want to change my code to make it better. The problem was that true definition is "__ICCARM__" not "ICCARM" You should see the same definitions below in main.h.

AbidHussain70 commented 4 years ago

ok, I will check it tomorrow again and I will update you. But with the above mentioned way I got the .hex files.

Capture10
AbidHussain70 commented 4 years ago

if defined(ICCARM) // IAR

include "intrinsics.h"

endif

I tried these lines also, but I was getting the same error. So I just add the following line,

include "intrinsics.h".

And it works.