Skip to content

Commit

Permalink
Fix #17 by initializing GPIO36 to OUTPUT LOW
Browse files Browse the repository at this point in the history
  • Loading branch information
pablosun committed May 24, 2017
1 parent 762217e commit bf5afca
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ int __io_getchar(void)
* For The System
*
*/

static void init_sys_clk(void)
{
top_xtal_init();
Expand All @@ -121,6 +120,15 @@ static void init_sys_clk(void)
cmnSerialFlashClkConfTo64M();
}

static void init_usr_led(void)
{
// Make sure the USR LED (GPIO36 / pin 7) is OFF
// by system default.
hal_pinmux_set_function(HAL_GPIO_36, 8);
hal_gpio_set_direction(HAL_GPIO_36, HAL_GPIO_DIRECTION_OUTPUT);
hal_gpio_set_output(HAL_GPIO_36, 0);
}

#if 0
LOG_CONTROL_BLOCK_DECLARE(wifi);
LOG_CONTROL_BLOCK_DECLARE(common);
Expand All @@ -143,6 +151,9 @@ void init_system(void)
{
init_sys_clk();

// ensure the USR LED is default OFF
init_usr_led();

/* Init the UART for stdio */
init_stdio();

Expand Down

0 comments on commit bf5afca

Please sign in to comment.