Skip to content

Commit

Permalink
Minor code style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
igrr committed Apr 30, 2015
1 parent c209af0 commit cdd2fed
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
14 changes: 7 additions & 7 deletions hardware/esp8266com/esp8266/cores/esp8266/Esp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void EspClass::restart(void)
system_restart();
}

uint16_t EspClass::getVCC(void)
uint16_t EspClass::getVcc(void)
{
return system_get_vdd33();
}
Expand All @@ -89,7 +89,7 @@ uint32_t EspClass::getChipId(void)
return system_get_chip_id();
}

const char * EspClass::getSDKversion(void)
const char * EspClass::getSdkVersion(void)
{
return system_get_sdk_version();
}
Expand All @@ -104,7 +104,7 @@ uint8_t EspClass::getBootMode(void)
return system_get_boot_mode();
}

uint8_t EspClass::getCPUfreqMHz(void)
uint8_t EspClass::getCpuFreqMHz(void)
{
return system_get_cpu_freq();
}
Expand All @@ -121,7 +121,7 @@ uint32_t EspClass::getFlashChipSize(void)
uint8_t * bytes = (uint8_t *) &data;
// read first 4 byte (magic byte + flash config)
if(spi_flash_read(0x0000, &data, 4) == SPI_FLASH_RESULT_OK) {
switch((bytes[3] & 0xF0) >> 4) {
switch((bytes[3] & 0xf0) >> 4) {
case 0x0: // 4 Mbit (512KB)
return (512 * kB);
case 0x1: // 2 MBit (256KB)
Expand Down Expand Up @@ -152,7 +152,7 @@ uint32_t EspClass::getFlashChipSpeed(void)
return (26 * MHz);
case 0x2: // 20 MHz
return (20 * MHz);
case 0xF: // 80 MHz
case 0xf: // 80 MHz
return (80 * MHz);
default: // fail?
return 0;
Expand All @@ -163,14 +163,14 @@ uint32_t EspClass::getFlashChipSpeed(void)

FlashMode_t EspClass::getFlashChipMode(void)
{
FlashMode_t mode = FM_FAILD;
FlashMode_t mode = FM_UNKNOWN;
uint32_t data;
uint8_t * bytes = (uint8_t *) &data;
// read first 4 byte (magic byte + flash config)
if(spi_flash_read(0x0000, &data, 4) == SPI_FLASH_RESULT_OK) {
mode = (FlashMode_t) bytes[2];
if(mode > FM_DOUT) {
mode = FM_FAILD;
mode = FM_UNKNOWN;
}
}
return mode;
Expand Down
12 changes: 6 additions & 6 deletions hardware/esp8266com/esp8266/cores/esp8266/Esp.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ typedef enum {
FM_QOUT = 0x01,
FM_DIO = 0x02,
FM_DOUT = 0x03,
FM_FAILD = 0xFF
FM_UNKNOWN = 0xff
} FlashMode_t;

class EspClass {
Expand All @@ -63,28 +63,28 @@ class EspClass {

// TODO: figure out how to set WDT timeout
void wdtEnable(uint32_t timeout_ms = 0);
// note: setting the timeout value is not implemented at the moment
void wdtEnable(WDTO_t timeout_ms = WDTO_0MS);

void wdtDisable(void);
void wdtFeed(void);

void deepSleep(uint32_t time_us, WakeMode mode = WAKE_RF_DEFAULT);


void reset(void);
void restart(void);
uint16_t getVCC(void);

uint16_t getVcc(void);
uint32_t getFreeHeap(void);

uint32_t getChipId(void);


const char * getSDKversion(void);
const char * getSdkVersion(void);

uint8_t getBootVersion(void);
uint8_t getBootMode(void);

uint8_t getCPUfreqMHz(void);
uint8_t getCpuFreqMHz(void);

uint32_t getFlashChipId(void);
uint32_t getFlashChipSize(void);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ class ESP8266WiFiClass
*/
bool smartConfigDone();

/*
* Stop SmartConfig
*
*/
void stopSmartConfig();

friend class WiFiClient;
Expand Down
2 changes: 1 addition & 1 deletion hardware/tools/esp8266/sdk/ld/eagle.app.v6.ld
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ SECTIONS
_irom0_text_start = ABSOLUTE(.);
*core_esp8266_*.o(.literal*, .text*)
*.cpp.o(.literal*, .text*)
*libm.a:(.literal .text .literal.* .text.*)
*libm.a:(.literal .text .literal.* .text.*)
*libsmartconfig.a:(.literal .text .literal.* .text.*)
*(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
_irom0_text_end = ABSOLUTE(.);
Expand Down

0 comments on commit cdd2fed

Please sign in to comment.