Skip to content

Commit d7f49f7

Browse files
fix canopen_sample
Signed-off-by: Taylor Lineman <git@actuallytaylor.com>
1 parent 62ab432 commit d7f49f7

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

samples/canopen/canopen_sample/main.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,18 @@ int main() {
5050
// Initialize system
5151
core::platform::init();
5252

53+
// Initialize a configuration object for the timer.
54+
dev::TimerConfiguration configuration = {
55+
TIM_COUNTERMODE_UP,
56+
TIM_CLOCKDIVISION_DIV1,
57+
TIM_AUTORELOAD_PRELOAD_ENABLE,
58+
TIM_CLOCKSOURCE_INTERNAL,
59+
TIM_TRGO_RESET,
60+
TIM_MASTERSLAVEMODE_DISABLE
61+
};
62+
5363
// Initialize the timer
54-
dev::Timer& timer = dev::getTimer<dev::MCUTimer::Timer2>(100);
64+
dev::Timer& timer = dev::getTimer<dev::MCUTimer::Timer2>(100, configuration);
5565

5666
// UART for testing
5767
io::UART& uart = io::getUART<io::Pin::UART_TX, io::Pin::UART_RX>(9600);

0 commit comments

Comments
 (0)