Jump to content

maqtech

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by maqtech

  1. Thank you Tectu,

    The led within the kit is working fine, but the other pads don't work, even from other threads, I made a simple example as following, as result the led within the kit blinks but the other output which are also connected to led dont do.

    Please help me to correct the problem.

    Blink thread


    static WORKING_AREA(mythreadblinkLED1, 100);
    static msg_t Thread1(void *arg) {

    (void)arg;
    chRegSetThreadName("blinker");

    while (TRUE) {
    sysLock();
    palClearPad(GPIOB, 0);
    palClearPad(GPIOE,12);
    palClearPad(GPIOE,13);
    palClearPad(GPIOE,14);
    palClearPad(GPIOE,15);
    chThdSleepMilliseconds(500);
    palSetPad(GPIOB, 0);
    palSetPad(GPIOE,12);
    palSetPad(GPIOE,13);
    palSetPad(GPIOE,14);
    palSetPad(GPIOE,15);
    chThdSleepMilliseconds(500);
    sysUnlock();
    }
    }

    The main is simple and without events :




    halInit();
    chSysInit();
    palSetPadMode(GPIOE, 12, PAL_MODE_OUTPUT_PUSHPULL);
    palSetPadMode(GPIOE, 13, PAL_MODE_OUTPUT_PUSHPULL);
    palSetPadMode(GPIOE, 14, PAL_MODE_OUTPUT_PUSHPULL);
    palSetPadMode(GPIOE, 15, PAL_MODE_OUTPUT_PUSHPULL);
    GEvent* pe;
    gfxInit();
    gwinSetDefaultFont(gdispOpenFont("UI2"));
    gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
    gdispClear(White);
    gwinAttachMouse(0);
    createWidgets();
    geventListenerInit(&gl);
    gwinAttachListener(&gl);

    chThdCreateStatic(mythreadblinkLED1, sizeof(mythreadblinkLED1), NORMALPRIO, Thread1, NULL);

    while(1) {

    pe = geventEventWait(&gl, TIME_INFINITE);

    switch(pe->type) {
    case GEVENT_GWIN_BUTTON:
    break;

    default:
    break;
    }
    }

    return 0;

    Thanks in advance!!

  2. thank you very much :),

    now, I'm able to retreive the data and update it in the screen, but in the reverse way I can't.

    I'm using Hy-mini32D and I want to light on a led on the PORTE when I click on a button, using chibios alone, I can flush all the leds without problems, but when I use ugfx I cannot do that.

    Could you please help me to resolve this issue ?

×
×
  • Create New...