Conversation
…harging payload and airbrakes also send 5v/13v current messages from airbrake/payload
| @@ -1,5 +1,5 @@ | |||
| #include <xc.h> | |||
| #include "canlib.h" | |||
| #include "canlib/canlib.h" | |||
There was a problem hiding this comment.
like i think i said in the slack thread, idk my computer just has this weird issue. probably a config file thing. but this is how i've chosen to fix it and im tired of keeping 2 versions of the code with and without the canlib/canlib.h thing
| const uint32_t BOOST_LENGTH_MS = 1000; // for the purposes of debugging | ||
| const uint32_t COAST_LENGTH_MS = 2000000; // see above | ||
| const uint32_t BOOST_LENGTH_MS = 9000; | ||
| const uint32_t COAST_LENGTH_MS = 35000-9000; |
There was a problem hiding this comment.
I feel like this should be 35000 - BOOST_LENGTH_MS
There was a problem hiding this comment.
true i thought abt doing that dunno why i didnt
| #endif | ||
|
|
||
| #if (BOARD_UNIQUE_ID == BOARD_ID_CHARGING_AIRBRAKE) | ||
| //suspicious lmao |
There was a problem hiding this comment.
is it actually sussy still?
There was a problem hiding this comment.
well we tested it and it works so not sussy anymore?
There was a problem hiding this comment.
This and the other notes about code comments were mostly rhetorical. Probably could have communicated that better. Anyway, this and all the other comments that are out of date/not relevant should be removed.
| ADRPT = 0x00; | ||
| // ADPCH ANC4; | ||
| ADPCH = 0b010100;//x00; | ||
| ADPCH = 0b111111;//0b010100;//x00; |
There was a problem hiding this comment.
wtf is happening here
There was a problem hiding this comment.
adc settings shit
There was a problem hiding this comment.
i could change that back but i dont think it makes a real difference
There was a problem hiding this comment.
I think its fine if you don't comment the lines, but then get rid of the commented-out code
| typedef uint16_t adc_result_t; | ||
| #ifndef int24_t | ||
| typedef signed short long int int24_t; | ||
| //typedef signed long int int24_t; |
There was a problem hiding this comment.
what made it necessary to change the mcc file?
There was a problem hiding this comment.
issues with compiling
There was a problem hiding this comment.
and int24_t more or less doesnt seem to be used anywhere that we care about so it wasnt worth trying to save it
There was a problem hiding this comment.
issues with compiling
Would be nice to solve the root cause. Like, what's the actual error? Did you google it?
| uint32_t bitWrite = (uint32_t) ((pulseWidth_us * 48) / 128); //48 is Fosc in MHz, 128 is prescaler | ||
| //write PW/(Tosc * prescale value) | ||
| CCPR3L = bitWrite & 0xFF; | ||
| CCPR3H = (bitWrite >> 8) & 0x03; //honestly not sure abt this either this is like a very rough guess but as long as the servo wiggles its fine |
There was a problem hiding this comment.
are you sure about it now?
There was a problem hiding this comment.
yes it clearly works. i wasnt sure about it like 4 months ago when i first wrote this code
battery voltage now sends regardless of error
payload and airbrakes now send 5v/13v current messages
LEDs now depend on the real state of the charging/5v/motor pins not if the board received can messages
red LED is ALWAYS charging
blue LED is 5v output on charging_can and motor power on the motor boards
battery charging is no longer set false during the initialization sequence in main.c (its redundant as its already initialized off during pin initialization)