Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: BREMS/BREMSConfig.cpp
- Revision:
- 189:760cd81a7633
- Parent:
- 188:43f50a4cc040
- Child:
- 190:01674f19f9ce
--- a/BREMS/BREMSConfig.cpp Sat Feb 10 00:13:04 2018 +0000 +++ b/BREMS/BREMSConfig.cpp Sat Feb 10 02:47:07 2018 +0000 @@ -32,7 +32,7 @@ TIM1->EGR |= TIM_EGR_UG; TIM1->PSC = 0x00; //no prescaler, timer counts up in sync with the peripheral clock - TIM1->ARR = (int) (2 * (float) 9e7 / F_SW); + TIM1->ARR = (int) (2 * (float) 9e7 / _F_SW); TIM1->CCER |= ~(TIM_CCER_CC1NP); //Interupt when low side is on. TIM1->CR1 |= TIM_CR1_CEN; @@ -100,7 +100,9 @@ io->pc->baud(115200); BREMSStartupMsg(read, io->pc); - + + wait_ms(750); + io->pref = new PreferenceWriter(6); cmd_reload(io->pc, io->pref); if (_PREFS_VALID != 1) { @@ -109,17 +111,15 @@ io->pc->printf("%s\n", "You should probably at least set throttle and current limits!"); } - io->pos = new PositionSensorEncoder(CPR, 0); - io->logger = new BufferedLogger(LOG_PACKET_SIZE, (LOG_PAGE_SIZE-LOG_HEADER_SIZE)/(LOG_PACKET_SIZE+1), LOG_TX, LOG_RX, LOG_BAUD_RATE); - - wait_ms(750); + io->pos = new PositionSensorEncoder(_CPR, 0); + io->logger = new BufferedLogger(_LOG_PACKET_SIZE, (_LOG_PAGE_SIZE-_LOG_HEADER_SIZE)/(_LOG_PACKET_SIZE+1), LOG_TX, LOG_RX, _LOG_BAUD_RATE); - io->throttle_in = new PwmIn(TH_PIN, TH_LIMIT_LOW, TH_LIMIT_HIGH); + io->throttle_in = new PwmIn(TH_PIN, _TH_LIMIT_LOW, _TH_LIMIT_HIGH); - control->throttle_filter = new MedianFilter(THROTTLE_FILTER_WINDOW); - control->velocity_filter = new MedianFilter(W_FILTER_WINDOW); + control->throttle_filter = new MedianFilter(_THROTTLE_FILTER_WINDOW); + control->velocity_filter = new MedianFilter(_W_FILTER_WINDOW); - read->vbus = BUS_VOLTAGE; + read->vbus = _BUS_VOLTAGE; read->w = 0.0f; read->ia_supp_offset = 0.0f; read->ib_supp_offset = 0.0f;