changes, enable ethernet
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
#include <spi.h>
|
||||
#include <assert.h>
|
||||
|
||||
#define CONFIG_MAGIC 0xdead0001
|
||||
#define CONFIG_MAGIC 0xdead0003
|
||||
|
||||
typedef struct __attribute__((__packed__)) s_configBlock {
|
||||
uint32_t configMagic;
|
||||
|
@ -10,7 +10,7 @@
|
||||
t_configBlock defaultConfigBlock = {
|
||||
.configMagic = CONFIG_MAGIC,
|
||||
.deviceName = "MBGW3",
|
||||
.macAddress = { 0x00, 0xA0, 0x57, 0x05, 0x3E, 0x0D },
|
||||
.macAddress = { 0x00, 0xA0, 0x57, 0x05, 0x3E, 0x0E },
|
||||
.filler = { 0 }
|
||||
};
|
||||
|
||||
|
@ -21,7 +21,7 @@ static const uint8_t EEPROM_WREN = 0x06;
|
||||
// static const uint8_t EEPROM_WRSR = 0x01;
|
||||
|
||||
|
||||
static const uint32_t EEPROM_MAGIC = 0xaffe0009;
|
||||
static const uint32_t EEPROM_MAGIC = 0xaffe000a;
|
||||
|
||||
|
||||
static const uint16_t EEPROM_HEADER_ADDR = EEPROM_BASE_ADDR;
|
||||
|
@ -29,7 +29,7 @@ void my_errorHandler() {
|
||||
}
|
||||
|
||||
void second_tick(void *handle) {
|
||||
logMsg("Tick");
|
||||
coloredMsg(LOG_BLUE, false, "Tick");
|
||||
}
|
||||
|
||||
|
||||
@ -43,14 +43,14 @@ void my_setup_2() {
|
||||
|
||||
configInit();
|
||||
|
||||
// wizInit();
|
||||
wizInit();
|
||||
|
||||
// cmdHandlerInit();
|
||||
|
||||
schAdd(second_tick, NULL, 0, 60*1000);
|
||||
|
||||
|
||||
HAL_TIM_IC_Start_IT(&mainsCnt, TIM_CHANNEL_1);
|
||||
// HAL_TIM_IC_Start_IT(&mainsCnt, TIM_CHANNEL_1);
|
||||
|
||||
logMsg("Application running");
|
||||
}
|
||||
@ -95,7 +95,7 @@ void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim) {
|
||||
} else if (state == 1) {
|
||||
show(DEBUG_2, OFF);
|
||||
uint32_t captured = (savedV < v) ? (v - savedV) : ((htim->Init.Period - savedV) + v);
|
||||
double f = 1.0 / ((double)captured) * 1.0e6 * 2;
|
||||
double f = 1.0 / ((double)captured) * 1.0e6;
|
||||
logMsg("CCR: %ld, %f", captured, f);
|
||||
state = 0;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user