Jump to content

yaoyutaoTom

Members
  • Posts

    9
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. geventAttachSource(&gl, ginputGetKeyboard(0), GLISTEN_KEYTRANSITIONS|GLISTEN_KEYUP);
  2. can I run the demo in VS 2015 ? if so, how do I change the setting for my project ?
  3. I want to run a demo on pc with code::block. I create a new empty project. And I add the file to the project. But the project do not run, I do not know how to set the project.
  4. Now, I have completed a key driver, #define GINPUT_TOGGLE_NUM_PORTS 3 // The total number of toggle inputs #define GINPUT_TOGGLE_CONFIG_ENTRIES 1 #define GINPUT_TOGGLE_DECLARE_STRUCTURE() \ const GToggleConfig GInputToggleConfigTable[GINPUT_TOGGLE_CONFIG_ENTRIES] = { \ {GPIOC, \ GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_9, \ GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_9, \ GPIO_Mode_IN} \ } GINPUT_TOGGLE_DECLARE_STRUCTURE(); void ginput_lld_toggle_init(const GToggleConfig *ptc) { key_init(); } unsigned ginput_lld_toggle_getbits(const GToggleConfig *ptc) { return GPIO_ReadInputData(GPIOC); } if the key GPIOC.7 is pressed, how do I check the key event in a win ?
  5. I want to implement a key driver. And I see the example in the gdrivers. GINPUT_TOGGLE_DECLARE_STRUCTURE(); void ginput_lld_toggle_init(const GToggleConfig *ptc) { palSetGroupMode(((IOBus *)ptc->id)->portid, ptc->mask, 0, ptc->mode); } unsigned ginput_lld_toggle_getbits(const GToggleConfig *ptc) { return palReadBus((IOBus *)ptc->id); } // Describes how the toggle bits are obtained typedef struct GToggleConfig_t { void *id; unsigned mask; unsigned invert; unsigned mode; } GToggleConfig; But I have no idea how to write the code, is there a example ? what's the mean of invert ? I use in bare metal mode. no palSetGroupMode() function, no IOBus * type
  6. how to set button background color and foreground color ?
  7. SysTick_Handler() get called. Because delay(250) is OK. I am using the UGFX 2.7.
  8. thanks for you ! my mcu is stm32F407, I use the STM32F4xx_DSP_StdPeriph_Lib_V1.7.1. I am using bare metal mode, keil 5.
  9. I run the demo arcsectors. But the gfxSleepMilliseconds() stuck. here is my code int main(void) { coord_t width, height, r1, r2, cx, cy; uint8_t sectors; SysTick_Config(SystemCoreClock / 1000); NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); lcd_init(); win_flash(); delay(1000); lcd_clear(); gfxInit(); // Get the screen size width = gdispGetWidth(); height = gdispGetHeight(); // Initialize some variables r1 = width > height ? height/3 : width/3; r2 = r1*3/4; cx = width/2; cy = height/2; sectors = 1; while(1) { // Draw the arc sectors gdispClear(White); gdispDrawArcSectors(cx, cy, r1, sectors, Black); gdispFillArcSectors(cx, cy, r2, sectors, Black); // Increase the sectors counter sectors++; // Waste some time gfxSleepMilliseconds(250); } } static volatile uint32_t gfx_tick = 0; static volatile uint32_t cnt = 0; systemticks_t gfxSystemTicks(void) { return gfx_tick; } systemticks_t gfxMillisecondsToTicks(delaytime_t ms) { return ms; } void SysTick_Handler(void) { gfx_tick ++; if (0 != cnt) cnt--; } extern void delay(uint16_t val) { cnt = val; while(cnt); } if I replace the gfxSleepMilliseconds(250) with delay(250), it is OK. what is wrong with it ?
×
×
  • Create New...