Skip to content

Commit

Permalink
style: fix some style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Hossein-M98 committed Sep 27, 2023
1 parent f605090 commit 866489f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
3 changes: 3 additions & 0 deletions TM1638.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ TM1638_SetMultipleDigit_HEX(TM1638_Handler_t *Handler, const uint8_t *DigitData,
(const uint8_t *)DigitDataHEX, StartAddr, Count);
}


/**
* @brief Set data to multiple digits in char format
* @param Handler: Pointer to handler
Expand Down Expand Up @@ -725,6 +726,8 @@ TM1638_SetMultipleDigit_CHAR(TM1638_Handler_t *Handler, const uint8_t *DigitData
(const uint8_t *)DigitDataHEX, StartAddr, Count);
}



/**
==================================================================================
##### Public Keypad Functions #####
Expand Down
5 changes: 4 additions & 1 deletion TM1638.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ TM1638_Result_t
TM1638_SetMultipleDigit_HEX(TM1638_Handler_t *Handler, const uint8_t *DigitData,
uint8_t StartAddr, uint8_t Count);


/**
* @brief Set data to multiple digits in char format
* @param Handler: Pointer to handler
Expand All @@ -283,7 +284,9 @@ TM1638_SetMultipleDigit_HEX(TM1638_Handler_t *Handler, const uint8_t *DigitData,
*/
TM1638_Result_t
TM1638_SetMultipleDigit_CHAR(TM1638_Handler_t *Handler, const uint8_t *DigitData,
uint8_t StartAddr, uint8_t Count);
uint8_t StartAddr, uint8_t Count);



/**
==================================================================================
Expand Down
18 changes: 12 additions & 6 deletions TM1638_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,12 @@ TM1638_DioWrite(uint8_t Level)
#elif defined(TM1638_PLATFORM_STM32)
HAL_GPIO_WritePin(TM1638_DIO_GPIO, TM1638_DIO_PIN, Level);
#elif defined(TM1638_PLATFORM_STM32_LL)
if( Level != 0u) {
if(Level)
{
LL_GPIO_SetOutputPin(TM1638_DIO_GPIO, TM1638_DIO_PIN);
}
else {
else
{
LL_GPIO_ResetOutputPin(TM1638_DIO_GPIO, TM1638_DIO_PIN);
}
#elif defined(TM1638_PLATFORM_ESP32_IDF)
Expand Down Expand Up @@ -220,10 +222,12 @@ TM1638_ClkWrite(uint8_t Level)
#elif defined(TM1638_PLATFORM_STM32)
HAL_GPIO_WritePin(TM1638_CLK_GPIO, TM1638_CLK_PIN, Level);
#elif defined(TM1638_PLATFORM_STM32_LL)
if( Level != 0u) {
if(Level)
{
LL_GPIO_SetOutputPin(TM1638_CLK_GPIO, TM1638_CLK_PIN);
}
else {
else
{
LL_GPIO_ResetOutputPin(TM1638_CLK_GPIO, TM1638_CLK_PIN);
}
#elif defined(TM1638_PLATFORM_ESP32_IDF)
Expand All @@ -242,10 +246,12 @@ TM1638_StbWrite(uint8_t Level)
#elif defined(TM1638_PLATFORM_STM32)
HAL_GPIO_WritePin(TM1638_STB_GPIO, TM1638_STB_PIN, Level);
#elif defined(TM1638_PLATFORM_STM32_LL)
if( Level != 0u) {
if(Level)
{
LL_GPIO_SetOutputPin(TM1638_STB_GPIO, TM1638_STB_PIN);
}
else {
else
{
LL_GPIO_ResetOutputPin(TM1638_STB_GPIO, TM1638_STB_PIN);
}
#elif defined(TM1638_PLATFORM_ESP32_IDF)
Expand Down
3 changes: 1 addition & 2 deletions TM1638_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ extern "C" {
*/
// #define TM1638_PLATFORM_AVR // ATmega32
// #define TM1638_PLATFORM_STM32 // HAL Functions
#define TM1638_PLATFORM_STM32_LL // LL Functions
// #define TM1638_PLATFORM_STM32_LL // LL Functions
// #define TM1638_PLATFORM_ESP32_IDF // ESP-IDF


Expand Down Expand Up @@ -91,7 +91,6 @@ extern "C" {
#define TM1638_STB_GPIO GPIOA
#define TM1638_STB_PIN LL_GPIO_PIN_3


#elif defined(TM1638_PLATFORM_ESP32_IDF)
/**
* @brief Specify IO Pins of ESP32 connected to TM1638
Expand Down

0 comments on commit 866489f

Please sign in to comment.