Browse Source

update

master
zhaohe 1 year ago
parent
commit
83ac202443
  1. 6
      usrc/base_service/light_ctrl_service.c
  2. 7
      usrc/main.cpp
  3. 6
      usrc/project_configs.h

6
usrc/base_service/light_ctrl_service.c

@ -4,9 +4,9 @@ zaf_gpio_t glight;
zaf_gpio_t blight;
void LightCtrlService_init() {
zaf_gpio_init_as_output(&rlight, LED_R_PIN, kxs_gpio_nopull, false, false);
zaf_gpio_init_as_output(&glight, LED_G_PIN, kxs_gpio_nopull, false, false);
zaf_gpio_init_as_output(&blight, LED_B_PIN, kxs_gpio_nopull, false, false);
zaf_gpio_init_as_output(&rlight, LED_R_PIN, kxs_gpio_nopull, true, false);
zaf_gpio_init_as_output(&glight, LED_G_PIN, kxs_gpio_nopull, true, false);
zaf_gpio_init_as_output(&blight, LED_B_PIN, kxs_gpio_nopull, true, false);
}
void LightCtrlService_RedLight_setState(bool state) { zaf_gpio_write(&rlight, state); }

7
usrc/main.cpp

@ -111,7 +111,7 @@ void umain() {
ZLOGI(TAG, "sn: %x:%x:%x", sn.sn0, sn.sn1, sn.sn2);
LightCtrlService_init();
LightCtrlService_GreenLight_setState(true);
LightCtrlService_BlueLight_setState(true);
/**
* @brief
@ -160,8 +160,8 @@ void umain() {
extern_if_service_init();
zaf_gpio_init_as_output(&m_fan0_power, PD0, kxs_gpio_pullup, false, true);
zaf_gpio_init_as_output(&m_fan1_power, PD1, kxs_gpio_pullup, false, true);
zaf_gpio_init_as_output(&m_fan0_power, PD0, kxs_gpio_pullup, true, false);
zaf_gpio_init_as_output(&m_fan1_power, PD1, kxs_gpio_pullup, true, false);
zaf_gpio_init_as_input(&m_fan0_state, PD5, kxs_gpio_pullup, kxs_gpio_rising_irq, false);
zaf_gpio_init_as_input(&m_fan1_state, PD6, kxs_gpio_pullup, kxs_gpio_rising_irq, false);
@ -170,7 +170,6 @@ void umain() {
int32_t count = 0;
while (true) {
osDelay(10);
count++;

6
usrc/project_configs.h

@ -9,7 +9,7 @@
#define PC_MANUFACTURER1 ('t' | 'o' << 8 | 'p' << 16 | '\0' << 24)
#define PC_PROJECT_NAME "zaf_lstc"
#define PC_IFLYTOP_ENABLE_OS 1
#define PC_DEVICE_TYPE ('c' | 'l' << 8 | 's' << 16 | 't' << 24)
#define PC_DEVICE_TYPE ('c' | 'l' << 8 | 's' << 16 | 't' << 24)
#define PC_DEBUG_UART huart1
#define PC_DEBUG_UART_DMA_HANDLER hdma_usart1_rx
@ -33,9 +33,9 @@
/**
* @brief ״ָ̬ʾµÆ
*/
#define LED_R_PIN PD9
#define LED_R_PIN PD11
#define LED_G_PIN PD10
#define LED_B_PIN PD11
#define LED_B_PIN PD9
#define SPI_CS PA4

Loading…
Cancel
Save