Removede FIFO Irq, Addded function for measuring and controlling motor speed
This commit is contained in:
1 parent
fc639b765e
commit
072f380b1d
3 files changed
+3
-1
No files matched your search
+1
-1
@@ -13,7 +13,7 @@ set(PICO_DECODER_PATH ${PROJECT_SOURCE_DIR})
|
|||||||
pico_sdk_init()
|
pico_sdk_init()
|
||||||
|
|
||||||
add_compile_options(-Wall
|
add_compile_options(-Wall
|
||||||
-Wno-format # int != int32_t as far as the compiler is concerned because gcc has int32_t as long int
|
-Wno-format # int != int32 _t as far as the compiler is concerned because gcc has int32_t as long int
|
||||||
-Wno-unused-function # we have some for the docs that aren't called
|
-Wno-unused-function # we have some for the docs that aren't called
|
||||||
-Wno-maybe-uninitialized
|
-Wno-maybe-uninitialized
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#define CV_51 0 //PID Control D_Factor
|
#define CV_51 0 //PID Control D_Factor
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const uint8_t CV_FUNCTION_ARRAY [256] = {
|
const uint8_t CV_FUNCTION_ARRAY [256] = {
|
||||||
// 31 30 29 28 - 27 26 25 24 -- 23 22 21 20 - 19 18 17 16 -- 15 14 13 12 - 11 10 9 8 -- 7 6 5 4 - 3 2 1 0 <- GPIO
|
// 31 30 29 28 - 27 26 25 24 -- 23 22 21 20 - 19 18 17 16 -- 15 14 13 12 - 11 10 9 8 -- 7 6 5 4 - 3 2 1 0 <- GPIO
|
||||||
// byte_3 -- byte_2 -- byte_1 -- byte_0
|
// byte_3 -- byte_2 -- byte_1 -- byte_0
|
||||||
|
|||||||
@@ -284,6 +284,7 @@ void pid_control(){
|
|||||||
busy_wait_us(10000);
|
busy_wait_us(10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void init_pwm(uint gpio) {
|
void init_pwm(uint gpio) {
|
||||||
uint slice_num = pwm_gpio_to_slice_num(gpio);
|
uint slice_num = pwm_gpio_to_slice_num(gpio);
|
||||||
uint32_t wrap_counter = 5000; // 5000 Cycles @ 125MHz for 1 Period -> 25kHz
|
uint32_t wrap_counter = 5000; // 5000 Cycles @ 125MHz for 1 Period -> 25kHz
|
||||||
|
|||||||
Reference in new issue
Block a user