wake-0 / fhvOS

This repository contains an os for the arm cortex a8 in combination with beaglebone.
GNU General Public License v2.0
7 stars 1 forks source link

[Timer] [Driver] refactor timer functions for timer1_ms #34

Open ghost opened 9 years ago

ghost commented 9 years ago

refactor existing timer functions to be able to run timer1 properly

wake-0 commented 9 years ago

I think it should be able to use a cast to a function pointer. So the buffer contains a function pointer and the buffer content should be cast to a function pointer --> no refactoring needed.

wake-0 commented 9 years ago

Example:

include

#include <stdlib.h>
void test(char* buf, int length) {

    void (*fptr)(void);
    fptr = (void (*)(void))buf;
    fptr();
}

void callMe(void) {
    printf("Call me");
}

int main(void) {
    char* buf = (char*)callMe;
    test(buf, 0);

    return EXIT_SUCCESS;
}
ghost commented 9 years ago

thanks, I appreciate your help!

trylimits commented 9 years ago

Pls close if clarified.

trylimits commented 9 years ago

@mpe5651 @Blackjack92 Why is this ticket sill open?

trylimits commented 9 years ago

Isn't this related to Bug #19? We should close either this or that ticket. @mpe5651 Pls decide which one is more related to the actual issue.