#avr Logs

May 03 2019

#avr Calendar

03:09 AM nohit: since this is a stm32 channel now: use float
03:31 AM nohit: this isnt exactly related but in our dive computer we use millimeters to store diving depth rather than meters. that way we can use intergers instead of floats
03:31 AM nohit: we copied the solution from here https://github.com/torvalds/subsurface-for-dirk/blob/master/core/units.h
03:32 AM day: nohit: i dont think fixedpoint works for this. because Y.XXX vs YYYYYYY
03:32 AM nohit: YYYYYY.XXX
03:33 AM day: yeah, but that would require a lot more memory
03:33 AM nohit: i dont know, i havent ever used it
03:36 AM day: is your dive computer opensource? pics?
03:36 AM nohit: no open source
03:37 AM nohit: http://ariadna.tech/
03:37 AM day: "we copied the solution from here" haha
03:39 AM nohit: well our product will eventually be compatible with subsurface so i dont think it hurts if we use same typedef structs
03:40 AM day: its just a bit confusing why its not opensource while reusing torvalds (im guessing gpl) code
03:41 AM nohit: "reusing torvarlds code"
03:41 AM nohit: its this line of code typedef struct
03:41 AM nohit: {
03:41 AM nohit: int32_t mm;
03:41 AM nohit: } depth_t; // depth to 2000 km
03:41 AM day: how do you do the "can record 3d routes"? purely via inertia/ orientation sensors?
03:41 AM day: ah
03:42 AM day: wow typedef in torvalds code. he hates on typedef in one of his talks
03:42 AM nohit: yeah
03:43 AM day: didnt expect that would give enough precision. but theres no other viable option anyways i guess
03:50 AM nohit: well there's an advenced dsp algorithm that does the job. i dont really know how it works nor do i care. its way out of my league.
04:07 AM day: it is quite amazing what you can do without gps. the germans shot rockets into london guided with just a gyro and an accelerometer.
04:07 AM nohit: yeah
04:09 AM cehteh: nohit: 1/1000 unit as kindof fixed point is sometimes convinient, but for the mcu its often easier to use power of 2 dividers
04:10 AM cehteh: like storing 1/1024mm ...
04:10 AM cehteh: integer caclculations are more exact then and can be implemented with simpler code
04:12 AM cehteh: even more simple when you can use byte boundaries /256 or /65538
04:30 AM nohit: well if it was my decision, i would just use float. if there's a FPU then use it
04:46 AM nohit: my linus-fanboy-co-worker thought that it was a nice trick. which it is but totally unneeded these days
05:21 AM day: i dont quite get why one would make a struct with one member
05:22 AM day: #define depth_t int32_t :P i guess it gives flexibility in case you want to add more to the struct but how likely is that with something like "depth"
05:43 AM cehteh: because only that is really typesafe in C
05:43 AM cehteh: typedef isnt a type definiiton, its only an alias
05:43 AM cehteh: structs define types
05:47 AM day: ah i see. i didnt look at the code. he did that for 10+ parameters
07:34 AM gsi__ is now known as gsi_
09:15 AM rue_mohr: :) integer math is pointless...
09:27 AM cehteh: lol
10:58 AM jackwilsdon: I'm hitting a weird boot loop when defining an ISR using `ISR(TIMER0_COMPA_vect)` on an Arduino Uno. I'm not using the Arduino IDE or any of their libraries, just plain old avr-gcc.
10:59 AM jackwilsdon: It happens with any ISR, be it `TIMER1` or `TIMERx_OVF_vect`
10:59 AM jackwilsdon: Here is the code and commands I'm using to compile it - https://gist.github.com/jackwilsdon/d9195ef141ea2288e4f9a4c007605367
10:59 AM jackwilsdon: Anyone know why this might be? I can tell it's a boot loop because the LED on the Arduino flashes 3 times every second or so.
11:01 AM jackwilsdon: If I remove the empty ISR definition then it starts up fine and does not get stuck in a boot loop.
11:08 AM jackwilsdon: I've posted a more detailed explanation on StackOverflow - https://arduino.stackexchange.com/questions/65083/isr-definition-causing-boot-loop
11:15 AM jackwilsdon: Turns out I was missing -mmcu on my linker call!
02:24 PM nohit: rue what are you doing?
02:24 PM nohit: why you need 0.100 to 10000000 ?
06:06 PM rue_mohr: thats the range of my freq gen
06:17 PM nohit: what kind of ui do you have
06:19 PM nohit: pics
11:30 PM rue_mohr: ok
11:30 PM rue_mohr: ...
11:58 PM day__ is now known as day