Skip to content

Commit

Permalink
cleanup library includes, enable uart in CMakeLists
Browse files Browse the repository at this point in the history
  • Loading branch information
NirajPatelRobots committed Oct 31, 2024
1 parent 0a6b6c8 commit 08a6c00
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
10 changes: 4 additions & 6 deletions i2c/mpu6050_i2c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ target_link_libraries(mpu6050_i2c MPU6050_i2c_pico_lib)

# create map/bin/hex file etc.
pico_add_extra_outputs(mpu6050_i2c)
# enable usb output, disable uart output
# enable usb and uart output
pico_enable_stdio_usb(mpu6050_i2c 1)
pico_enable_stdio_uart(mpu6050_i2c 0)
pico_enable_stdio_uart(mpu6050_i2c 1)

# add url via pico_set_program_url
example_auto_set_url(mpu6050_i2c)
Expand All @@ -26,16 +26,14 @@ target_link_libraries(mpu6050_i2c_scale_test MPU6050_i2c_pico_cpp_lib)

# create map/bin/hex file etc.
pico_add_extra_outputs(mpu6050_i2c_scale_test)
# enable usb output, disable uart output
pico_enable_stdio_usb(mpu6050_i2c_scale_test 1)
pico_enable_stdio_uart(mpu6050_i2c_scale_test 0)
pico_enable_stdio_uart(mpu6050_i2c_scale_test 1)


add_executable(mpu6050_i2c_irq mpu6050_i2c_irq_main.cpp)
target_link_libraries(mpu6050_i2c_irq MPU6050_i2c_pico_cpp_lib)

# create map/bin/hex file etc.
pico_add_extra_outputs(mpu6050_i2c_irq)
# enable usb output, disable uart output
pico_enable_stdio_usb(mpu6050_i2c_irq 1)
pico_enable_stdio_uart(mpu6050_i2c_irq 0)
pico_enable_stdio_uart(mpu6050_i2c_irq 1)
5 changes: 2 additions & 3 deletions i2c/mpu6050_i2c/mpu6050_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

#include <stdio.h>
#include <string.h>
#include <math.h>
#include "pico/stdlib.h"
#include <stdint.h>
#include "pico/binary_info.h"
#include "hardware/gpio.h"
#include "hardware/i2c.h"
#include "mpu6050_i2c.h"

Expand Down
4 changes: 1 addition & 3 deletions i2c/mpu6050_i2c/mpu6050_i2c.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/* header for accessing mpu6050 functions in pico-examples
Niraj Patel March 2022 */
/* mpu6050 functions in pico-examples */
#ifdef __cplusplus
extern "C" {
#endif
Expand Down

0 comments on commit 08a6c00

Please sign in to comment.