https://bitbucket.org/daniel_fort/magic-lantern
Raw File
Tip revision: 0018b6803d1bb341a0f06ee93a77b573e8ea5e80 authored by dannephoto on 21 March 2018, 10:12:58 UTC
Closed branch crop_rec_4k_mlv_lite_snd_6D_70D
Tip revision: 0018b68
vsync-lite.c
/** 
 * Vsync for LiveView - to be called from state-object.c
 * 
 **/

#include "dryos.h"

static struct msg_queue * vsync_msg_queue = 0;


void _lv_vsync_signal()
{
    msg_queue_post(vsync_msg_queue, 1);
}

void _lv_vsync(int mz)
{
    #if defined(CONFIG_DIGIC_V) || defined(CONFIG_60D)
    int msg;
    msg_queue_receive(vsync_msg_queue, (struct event**)&msg, 100);
    #else
    static int k = 0; k++;
    msleep(mz ? (k % 50 == 0 ? MIN_MSLEEP : 10) : MIN_MSLEEP);
    #endif
}

static void vsync_init()
{
    vsync_msg_queue = (void*)msg_queue_create("vsync_mq", 1);
}

INIT_FUNC("vsync", vsync_init);
back to top