Просмотр исходного кода

TWAI: Fix incorrect CAP name

Fixes a bug where SOC_TWAI_BRP_DIV_SUPPORTED was mistyped preventing
slower bit rates from being enabled on ESP32 revision 2 and 3 chips
Darian Leung 4 лет назад
Родитель
Сommit
44bc5411b7
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      components/hal/esp32/include/hal/twai_ll.h

+ 2 - 2
components/hal/esp32/include/hal/twai_ll.h

@@ -395,7 +395,7 @@ static inline uint32_t twai_ll_get_and_clear_intrs(twai_dev_t *hw)
  */
  */
 static inline void twai_ll_set_enabled_intrs(twai_dev_t *hw, uint32_t intr_mask)
 static inline void twai_ll_set_enabled_intrs(twai_dev_t *hw, uint32_t intr_mask)
 {
 {
-#if TWAI_BRP_DIV_SUPPORTED
+#if SOC_TWAI_BRP_DIV_SUPPORTED
     //ESP32 Rev 2 or later has brp div field. Need to mask it out
     //ESP32 Rev 2 or later has brp div field. Need to mask it out
     hw->interrupt_enable_reg.val = (hw->interrupt_enable_reg.val & 0x10) | intr_mask;
     hw->interrupt_enable_reg.val = (hw->interrupt_enable_reg.val & 0x10) | intr_mask;
 #else
 #else
@@ -421,7 +421,7 @@ static inline void twai_ll_set_enabled_intrs(twai_dev_t *hw, uint32_t intr_mask)
  */
  */
 static inline void twai_ll_set_bus_timing(twai_dev_t *hw, uint32_t brp, uint32_t sjw, uint32_t tseg1, uint32_t tseg2, bool triple_sampling)
 static inline void twai_ll_set_bus_timing(twai_dev_t *hw, uint32_t brp, uint32_t sjw, uint32_t tseg1, uint32_t tseg2, bool triple_sampling)
 {
 {
-#if TWAI_BRP_DIV_SUPPORTED
+#if SOC_TWAI_BRP_DIV_SUPPORTED
     if (brp > SOC_TWAI_BRP_DIV_THRESH) {
     if (brp > SOC_TWAI_BRP_DIV_THRESH) {
         //Need to set brp_div bit
         //Need to set brp_div bit
         hw->interrupt_enable_reg.brp_div = 1;
         hw->interrupt_enable_reg.brp_div = 1;