Disable debugging by default, enable wireless

This commit is contained in:
Jeremy Soller 2019-11-17 19:45:45 -07:00
parent 08717157db
commit 56ae9f788c
No known key found for this signature in database
GPG Key ID: E988B49EE78A7FB1
3 changed files with 16 additions and 2 deletions

View File

@ -80,7 +80,7 @@ void gpio_init() {
GPCRH2 = 0x44;
GPCRH3 = 0x44;
GPCRH4 = 0x80;
GPCRH5 = 0x80;
GPCRH5 = 0x44;
GPCRH6 = 0x80;
GPCRH7 = 0x80;
GPCRI0 = 0x00;
@ -108,6 +108,7 @@ void gpio_init() {
GPCRM6 = 0x00;
}
#if GPIO_DEBUG
void gpio_debug_bank(
char * bank,
uint8_t data,
@ -142,3 +143,4 @@ void gpio_debug(void) {
bank(J);
#undef bank
}
#endif

View File

@ -422,13 +422,17 @@ void main(void) {
static struct Gpio __code SCI_N = GPIO(D, 4);
static struct Gpio __code SWI_N = GPIO(E, 0);
static struct Gpio __code SB_KBCRST_N = GPIO(E, 6);
static struct Gpio __code BT_EN = GPIO(F, 3);
static struct Gpio __code PM_CLKRUN_N = GPIO(H, 0);
static struct Gpio __code BKL_EN = GPIO(H, 2);
static struct Gpio __code WLAN_EN = GPIO(H, 5);
// Set the battery full LED (to know our firmware is loading)
gpio_set(&LED_BAT_CHG, true);
#if GPIO_DEBUG
gpio_debug();
#endif
//battery_debug();
@ -436,6 +440,9 @@ void main(void) {
gpio_set(&SB_KBCRST_N, true);
// Allow backlight to be turned on
gpio_set(&BKL_EN, true);
// Enable wireless
gpio_set(&BT_EN, true);
gpio_set(&WLAN_EN, true);
// Assert SMI#, SCI#, and SWI#
gpio_set(&SCI_N, true);
gpio_set(&SMI_N, true);

View File

@ -2,8 +2,13 @@
#include <common/i2c.h>
#define I2C_DEBUGGER 0
// #define I2C_DEBUGGER 0x76
int putchar(int c) {
unsigned char byte = (unsigned char)c;
i2c_send(0x76, &byte, 1);
#if I2C_DEBUGGER
i2c_send(I2C_DEBUGGER, &byte, 1);
#endif
return (int)byte;
}