Comments (2)
Looking at the assembly output it looks like the compiler does not reduce this to 1/6000.
bl xTaskGetTickCount
mov r2, r0
mov r3, #1000
mul r3, r3, r2
.loc 1 1116 14
ldr r2, .L354
umull r2, r3, r2, r3
lsrs r3, r3, #19
So we have an explicit multiplication by 1000 and then a division by a constant. The value stored at L354 is 375299969, so the umul
followed by the shift corresponds to a multiplication of 1/5999999.999161332198245, i.e., 1/6e6.
from cm_mcu.
If I change the code in question to the following instead
TickType_t now = xTaskGetTickCount()/(configTICK_RATE_HZ*60); // time in minutes
the generated assembly is now
bl xTaskGetTickCount
mov r2, r0
.loc 1 1115 14
ldr r3, .L354
umull r2, r3, r3, r2
lsrs r3, r3, #7
where the value at 354 is now 91625969, which with the shift corresponds to multiplication by 1/6000.
from cm_mcu.
Related Issues (20)
- Clear sticky flags of clock synth status monitor
- add CLI command to program FPGA from flash
- Delay semaphore not taken in MONI2C and MON HOT 1
- ff xmit on all takes minutes to finish with warnings about clock monitor task HOT 4
- version string is wrong on tagged version
- Upgrade packer to new version 2 to allow MCU to send more FF data on UART Push link HOT 1
- Change the work-around for a FF struct with non-existing registers
- Add a tag version to cm_mcu and create a tar file
- Miscellenous bugs and corrections HOT 1
- MCU FW VER in stream of data sent to Zynq can be wrong HOT 2
- Create I2C device functionality for control of devices by SM/Zynq data path HOT 1
- BUG - Programming MCU FW + Resetting UIO Daemon HOT 4
- Per-Channel Monitoring Information for Fireflies HOT 4
- can't power up if stale values cause alarm
- update release generation to have the tar file structure built in
- update CM temperature monitor initial value
- Bug in firefly disable/enable laser HOT 1
- intermittent errors caused by readout of 12 channel, 25 Gbps FF
- FF IS_PRESENT Registers Giving Strange Results HOT 5
- Generic Alarm task uses one queue for messages, causes wrong task to receive clear message
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cm_mcu.