Hot answers tagged

8

I'm assuming that temperature[1] is an integer type of some sort. The subexpression (temperature[1] >> 5)*0.125 contains an operand 0.125 of type double, resulting in promotion throughout the whole expression. Try changing 0.125 to 0.125f, so that no promotion to double occurs.


3

You have an off by one error in your calculations and also kilobyte is not 1000 bytes but 1024. The device really has 256 kilobytes of memory. 2^18 is 262144 bytes and 262144 / 1024 is exactly 256 kilobytes. A kilobyte is 2^10 = 1024 bytes.


2

Some modern RISC processors have dedicated integer multiplication (or multiply-add or MAC) circuit blocks, some very small or low power ones don’t (some of the earliest RISC ISAs didn’t even have a MUL instruction). The multiply logic blocks are often just a bunch of layers of (3 input, 2 output) carry-save adders (mostly XOR gates), sometimes stacked, ...


2

Some faster and larger processors have hardware multiplier and some slower and smaller don't. Division can be also made faster with hardware. If there is no hardware to help, the software needs to perform multiplication and division with a software algorithm. While successive addition and subtraction can do it, there are faster ways to do it, for example ...


2

IAR is a proprietary IDE solution, where CCS and STM32CubeIDE buth use the open source project Eclipse as foundation. IAR uses project files, Eclipse uses workspace folders. Two completely different approaches with each their advantages or disadvantages. One of which is that you can't double-click on a folder and open it in a program. Perhaps there is some ...


2

The main is just like any other function. The project has custom statup code and what it does after returning from main depends on with what defines it was compiled with. One option is that it remains in an infinite loop so it halts. Another option is that the return value is an address of function to execute. Startup code for my ARM just resets the MCU so ...


1

I'm having a little trouble following what happened before you added the GPIO interrupt, and after. If I understand correctly, what was happening before you added it was: After the first (correct) sequence, you come out of the ISR with xFlag_42 set, and so eventually you end up in __AppliSendBuff(&command42). Midway through the __AppliSendBuff, the ...


Only top voted, non community-wiki answers of a minimum length are eligible