Search found 45 matches

by Spym
Sat Apr 28, 2018 6:55 pm
Forum: Bug Reports
Topic: C++ blocking API needs updating Topic is solved
Replies: 17
Views: 6791

Re: C++ blocking API needs updating Topic is solved

RAII is a common pattern in C++. The code I posted is a complete solution that requires no further modifications, it's quite well tested as well.
by Spym
Fri Apr 27, 2018 3:36 pm
Forum: Bug Reports
Topic: C++ blocking API needs updating Topic is solved
Replies: 17
Views: 6791

Re: C++ blocking API needs updating Topic is solved

Thanks. It also occurred to me that we're missing RAII helpers for mutexes and critical sections. I have them defined in my application, but there's no reason why they shouldn't be part of the OS. Consider the following code (copy-pasted from my application with minimal changes): namespace impl_ { c...
by Spym
Fri Apr 27, 2018 8:52 am
Forum: Bug Reports
Topic: C++ blocking API needs updating Topic is solved
Replies: 17
Views: 6791

Re: C++ blocking API needs updating Topic is solved

Sorry! I just looked at the code again and indeed, the problem is gone. Previously I was looking at an outdated file.

It's an unexpected solution but it works. It would make sense for the reference to be a base class of BaseThread, but it certainly isn't necessary.
by Spym
Wed Apr 25, 2018 1:46 pm
Forum: Bug Reports
Topic: C++ blocking API needs updating Topic is solved
Replies: 17
Views: 6791

Re: C++ blocking API needs updating Topic is solved

Thanks, Giovanni. - NULL comes from the underlying C code, I think it cannot be replaced. nullptr is backwards compatible with the NULL pointer. NULL should be replaced with nullptr in the wrapper in order to take advantages of the extra type safety and code correctness guarantees implemented in C++...
by Spym
Tue Apr 24, 2018 6:28 pm
Forum: Bug Reports
Topic: -fsingle-precision-constant breaks C++ standard library Topic is solved
Replies: 7
Views: 3573

Re: -fsingle-precision-constant breaks C++ standard library Topic is solved

faisal wrote:Fyi, some stm32f7s and the H7 I believe have hardware double float support... so there's that.


This is correct. Cortex M7 implemented in upper STM32's supports hardware double precision floating point arighmetic.
by Spym
Tue Apr 24, 2018 2:25 pm
Forum: Bug Reports
Topic: -fsingle-precision-constant breaks C++ standard library Topic is solved
Replies: 7
Views: 3573

Re: -fsingle-precision-constant breaks C++ standard library Topic is solved

Improving performance is great only as long as you don't break valid code :) The developer can always achieve identical results by using the single-precision suffix "F", e.g. "3.14F". All high-integrity coding standards I know (MISRA, HIC++) require this anyway, in order to avoid...
by Spym
Tue Apr 24, 2018 2:12 pm
Forum: Bug Reports
Topic: -fsingle-precision-constant breaks C++ standard library Topic is solved
Replies: 7
Views: 3573

Re: -fsingle-precision-constant breaks C++ standard library Topic is solved

The problem is that the option is needed when the FPU is only able to handle single precision floats as far I know. No, it's not true, it's easy to check by disabling the option (it is disabled in my application) and checking the compiled code (it still uses the FPU for floating-point arithmetics)....
by Spym
Tue Apr 24, 2018 12:43 pm
Forum: Bug Reports
Topic: -fsingle-precision-constant breaks C++ standard library Topic is solved
Replies: 7
Views: 3573

-fsingle-precision-constant breaks C++ standard library Topic is solved

This post is about GCC and C++. The flag -fsingle-precision-constant is harmful and should be removed from the default build configuration. 1. Its use is incompatible with the C++ standard library shipped with GCC (fails to compile). 2. The application may still need to perform double-precision arit...
by Spym
Sun Apr 22, 2018 4:34 pm
Forum: Small Change Requests
Topic: Support for RCC_DKCFGR.TIMPRE in newer STM32 Topic is solved
Replies: 23
Views: 11768

Re: Support for RCC_DKCFGR.TIMPRE in newer STM32 Topic is solved

Hi Giovanni,

Seems like this feature is only supported for STM32H7 at the moment (by virtue of STM32_TIMPRE_ENABLE). Are there plans to support it for STM32F4? Currently, my application has to tinker with registers manually to work around the lack of this feature.

Thanks!
by Spym
Sun Apr 22, 2018 3:01 pm
Forum: Bug Reports
Topic: C++ blocking API needs updating Topic is solved
Replies: 17
Views: 6791

Re: C++ blocking API needs updating Topic is solved

There is a "System" namespace defined in the header file and a "system" namespace (lowercase) in the cpp file. The cpp file only adds complexity to the build process and should be removed, it is not needed at all; all functions can be defined in the header file. In order to defin...

Go to advanced search