Skip to content

Commit

Permalink
fix: make it compilable with latest libocm3
Browse files Browse the repository at this point in the history
  • Loading branch information
amitesh-singh committed Dec 27, 2024
1 parent 7878297 commit 9dcedf2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@ i2c_slave_init(uint8_t ownaddress)
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_ALTFN_OPENDRAIN,
GPIO_I2C1_SCL); //PB6

i2c_reset(I2C1);
i2c_peripheral_disable(I2C1);

i2c_set_speed(I2C1, i2c_speed_sm_100k, I2C_CR2_FREQ_36MHZ);
i2c_set_speed(I2C1, i2c_speed_sm_100k, 36);
i2c_set_own_7bit_slave_address(I2C1, ownaddress);
i2c_enable_interrupt(I2C1, I2C_CR2_ITEVTEN | I2C_CR2_ITBUFEN);
i2c_peripheral_enable(I2C1);
Expand Down Expand Up @@ -139,8 +138,7 @@ extern "C" void i2c1_ev_isr(void)
int main( void )
{
//set STM32 to 72 MHz
rcc_clock_setup_in_hse_8mhz_out_72mhz();

rcc_clock_setup_pll(&rcc_hse_configs[RCC_CLOCK_HSE8_72MHZ]);
// Enable GPIOC clock
rcc_periph_clock_enable(RCC_GPIOC);
//Set GPIO13 (inbuild led connected) to 'output push-pull'
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ stinfo = find_program('st-info')
stflash = find_program('st-flash')

#define libopencm3 path here
libocm3Path = '/home/ami/repos/libopencm3'
libocm3Path = '/home/ami/work/repos/libopencm3'

#define cpu types here
cputype = 'cortex-m3'
Expand Down

0 comments on commit 9dcedf2

Please sign in to comment.