tenbaht / sduino

An Arduino-like programming API for the STM8
http://tenbaht.github.io/sduino/
GNU Lesser General Public License v2.1
349 stars 213 forks source link

Port PG is not working for stm8disco. #97

Open ptnicu opened 4 years ago

ptnicu commented 4 years ago

Due to missing the PF port the LUT tables (portto####_PGM) has wrong place for PG port. PG = 7, but its index in the table is 6. After adding PF port, the pins on PG port are working fine: const uint16_t PROGMEM port_to_mode_PGM[] = { NOT_A_PORT, GPIOA_BaseAddress+2, GPIOB_BaseAddress+2, GPIOC_BaseAddress+2, GPIOD_BaseAddress+2, GPIOE_BaseAddress+2, GPIOF_BaseAddress+2, GPIOG_BaseAddress+2, };

EG-bit commented 4 years ago

This solution didn't work for me. Can you write in more detail where you changed these lines of code?

ptnicu commented 3 years ago

Sorry for not being more specific. In the file sduino/stm8/variants/stm8sdisco/pins_arduino.h lines 228-235 the GPIOF is missing for stm8 discovery board.

Also the GPIOF port is missing from port_to_output_PGM, port_to_input_PGM declarations. Hope this helps.