Exemple #1
0
Font::Font(const FontPlatformData& platformData, bool isCustomFont, bool isLoading, bool isTextOrientationFallback)
    : m_maxCharWidth(-1)
    , m_avgCharWidth(-1)
    , m_platformData(platformData)
    , m_treatAsFixedPitch(false)
    , m_isCustomFont(isCustomFont)
    , m_isLoading(isLoading)
    , m_isTextOrientationFallback(isTextOrientationFallback)
    , m_isBrokenIdeographFallback(false)
    , m_mathData(nullptr)
#if ENABLE(OPENTYPE_VERTICAL)
    , m_verticalData(0)
#endif
    , m_hasVerticalGlyphs(false)
{
    platformInit();
    platformGlyphInit();
    platformCharWidthInit();
#if ENABLE(OPENTYPE_VERTICAL)
    if (platformData.orientation() == Vertical && !isTextOrientationFallback) {
        m_verticalData = platformData.verticalData();
        m_hasVerticalGlyphs = m_verticalData.get() && m_verticalData->hasVerticalMetrics();
    }
#endif
}
Exemple #2
0
int main()
{
    systemInit();
    platformInit();

    delay_ms(100);

    DEBUG_PRINT("init successfully\n");

    while(1){

        uint32_t systick = timerGetRun();

        mpu9150Get();

        // result = dmp_read_quat(quat, &more);
        // result = mpu_get_compass_reg(compass,&sensor_timestamp);

        while(timerGetRun() < systick + 49)
        {
            
        }

        sbn1HandleReceived();

    }
}
Exemple #3
0
Overlay::Overlay() : QObject() {
	d = NULL;

	platformInit();
	forceSettings();

	qlsServer = new QLocalServer(this);
	QString pipepath;
#ifdef Q_OS_WIN
	pipepath = QLatin1String("MumbleOverlayPipe");
#else
	pipepath = QDir::home().absoluteFilePath(QLatin1String(".MumbleOverlayPipe"));
	{
		QFile f(pipepath);
		if (f.exists()) {
			qWarning() << "Overlay: Removing old socket on" << pipepath;
			f.remove();
		}
	}
#endif

	if (! qlsServer->listen(pipepath)) {
		QMessageBox::warning(NULL, QLatin1String("Mumble"), tr("Failed to create communication with overlay at %2: %1. No overlay will be available.").arg(Qt::escape(qlsServer->errorString()), Qt::escape(pipepath)), QMessageBox::Ok, QMessageBox::NoButton);
	} else {
		qWarning() << "Overlay: Listening on" << qlsServer->fullServerName();
		connect(qlsServer, SIGNAL(newConnection()), this, SLOT(newConnection()));
	}

	QMetaObject::connectSlotsByName(this);
}
Exemple #4
0
int main() 
{
  //Initialize the platform.
  int err = platformInit();
  if (err != 0) {
    // The firmware is running on the wrong hardware. Halt
    while(1);
  }

  //Launch the system task that will initialize and start everything
  systemLaunch();

  //Start the FreeRTOS scheduler
  vTaskStartScheduler();

  //TODO: Move to platform launch failed
  ledInit();
  ledSet(0, 1);
  ledSet(1, 1);

  //Should never reach this point!
  while(1);

  return 0;
}
Exemple #5
0
SenseClient::SenseClient()
  : m_loader_init_complete(false), m_new_width(800), m_new_height(600), m_width(800), m_height(600)
{
  m_manager = new EntityManager;

  platformInit();
  m_pipeline = new Pipeline;
  if(!Loader::isThreaded()) {
    platformInitLoader();
    m_loader = m_pipeline->createLoader();
  }
  platformDetachContext(); // Some platforms (notably X11 with OpenGL) require contexts be unbound before sharing resources
  m_loader_thread = boost::thread(std::mem_fun(&SenseClient::runLoaderThread), this);
  while(!m_loader_init_complete) {}
  platformAttachContext();
  if(!loader_error_string.empty()) {
    m_loader_thread.join();
    delete m_pipeline;
    platformFinish();
    throw std::runtime_error(loader_error_string.c_str());
  }

  framebuffer = m_pipeline->createRenderTarget(width(), height(), false);
  m_pipeline->setViewport(width(), height());

  setupPythonModule();

  readScriptsDir("../data/materials", ".smtl");
  readScriptsDir("../data/definitions", ".sdef");

  m_pipeline->loadPipelineData(m_datamgr);
  m_test_ent = m_manager->createEntity("dummy");
};
int main(void) {
   volatile unsigned int initFlg = 1;
   platformInit();
   static char  buf[512];
   static char  fmmirrorbuf[512];
   for(int i=0;i < sizeof buf; i++){
      buf[i] = i;
   }


////////////////////////////////////////////
//dmtimerInitForMatch(MODULE_ID_TIMER3,0xffffffff-0x7ffffff,(0xffffffff-0x7ffffff/2),DMTIMER_FLAG_INTENABLE_MATCH);

//////////////////////////////////////////////////////
/*   spiFmromInit(fmmirrorbuf, sizeof fmmirrorbuf);
   spiFmromRead(0, buf, 1);
   spiFmromWren();
   delay(500);
   spiFmromWrite(0, buf, sizeof buf); 
   delay(500);
   spiFmromRead(0, buf, sizeof buf);
   while (1);*/
   moduleEnable(MODULE_ID_GPIO0);
   LCDRasterStart();    //lcd
   LCDBackLightON();
   MMCSDP_CtrlInfoInit(&mmcsdctr[0], MODULE_ID_MMCSD0, 48000000, MMCSD_BUSWIDTH_4BIT, 0,
                       &card0, NULL, NULL, NULL);
   MMCSDP_CtrlInit(&mmcsdctr[0]);
   MMCSDP_CardInit(&mmcsdctr[0], MMCSD_CARD_AUTO);
   TouchCalibrate(0);
   static FATFS inandfs;
   f_mount(0, &inandfs);
   initFont(FONT_LOAD_ADDR);
   drawText();
}
SimpleFontData::SimpleFontData(const FontPlatformData& f, bool customFont, bool loading, SVGFontData* svgFontData)
    : m_maxCharWidth(-1)
    , m_avgCharWidth(-1)
    , m_unitsPerEm(defaultUnitsPerEm)
    , m_platformData(f)
    , m_treatAsFixedPitch(false)
#if ENABLE(SVG_FONTS)
    , m_svgFontData(svgFontData)
#endif
    , m_isCustomFont(customFont)
    , m_isLoading(loading)
    , m_smallCapsFontData(0)
#if (PLATFORM(WKC))
    , m_lineSpacing(0)
#endif
{
#if !ENABLE(SVG_FONTS)
    UNUSED_PARAM(svgFontData);
#else
    if (SVGFontFaceElement* svgFontFaceElement = svgFontData ? svgFontData->svgFontFaceElement() : 0) {
        m_unitsPerEm = svgFontFaceElement->unitsPerEm();

        double scale = f.size();
        if (m_unitsPerEm)
            scale /= m_unitsPerEm;

        m_ascent = static_cast<int>(svgFontFaceElement->ascent() * scale);
        m_descent = static_cast<int>(svgFontFaceElement->descent() * scale);
        m_xHeight = static_cast<int>(svgFontFaceElement->xHeight() * scale);
        m_lineGap = 0.1f * f.size();
        m_lineSpacing = m_ascent + m_descent + m_lineGap;

        SVGFontElement* associatedFontElement = svgFontFaceElement->associatedFontElement();

        Vector<SVGGlyphIdentifier> spaceGlyphs;
        associatedFontElement->getGlyphIdentifiersForString(String(" ", 1), spaceGlyphs);
        m_spaceWidth = spaceGlyphs.isEmpty() ? m_xHeight : static_cast<float>(spaceGlyphs.first().horizontalAdvanceX * scale);

        Vector<SVGGlyphIdentifier> numeralZeroGlyphs;
        associatedFontElement->getGlyphIdentifiersForString(String("0", 1), numeralZeroGlyphs);
        m_avgCharWidth = numeralZeroGlyphs.isEmpty() ? m_spaceWidth : static_cast<float>(numeralZeroGlyphs.first().horizontalAdvanceX * scale);

        Vector<SVGGlyphIdentifier> letterWGlyphs;
        associatedFontElement->getGlyphIdentifiersForString(String("W", 1), letterWGlyphs);
        m_maxCharWidth = letterWGlyphs.isEmpty() ? m_ascent : static_cast<float>(letterWGlyphs.first().horizontalAdvanceX * scale);

        // FIXME: is there a way we can get the space glyph from the SVGGlyphIdentifier above?
        m_spaceGlyph = 0;
        determinePitch();
        m_adjustedSpaceWidth = roundf(m_spaceWidth);
        m_missingGlyphData.fontData = this;
        m_missingGlyphData.glyph = 0;
        return;
    }
#endif

    platformInit();
    platformGlyphInit();
    platformCharWidthInit();
}
Exemple #8
0
SpikeHw::SpikeHw(IrqCallback callback)
    : request(0), indication(0), dmaManager(0), didReset(false)
{
    request = new SpikeHwRequestProxy(IfcNames_SpikeHwRequestS2H);
    indication = new SpikeHwIndication(IfcNames_SpikeHwIndicationH2S, callback);
    dmaManager = platformInit();
    request->setFlashParameters(100);
}
Exemple #9
0
int main(int argc, const char **argv)
{
    int test_result = 0;
    int srcAlloc;
    unsigned int *srcBuffer = 0;

    fprintf(stderr, "Main::%s %s\n", __DATE__, __TIME__);
    DmaManager *dma = platformInit();
    ReadTestRequestProxy *device = new ReadTestRequestProxy(IfcNames_ReadTestRequestS2H,TILE_NUMBER);
    ReadTestIndication memReadIndication(IfcNames_ReadTestIndicationH2S,TILE_NUMBER);

    fprintf(stderr, "Main::allocating memory...\n");
    srcAlloc = portalAlloc(alloc_sz, 0);
    srcBuffer = (unsigned int *)portalMmap(srcAlloc, alloc_sz);
    for (int i = 0; i < numWords; i++)
        srcBuffer[i] = i;
    portalCacheFlush(srcAlloc, srcBuffer, alloc_sz, 1);
    fprintf(stderr, "Main::flush and invalidate complete\n");

    /* Test 1: check that match is ok */
    unsigned int ref_srcAlloc = dma->reference(srcAlloc);
    fprintf(stderr, "ref_srcAlloc=%d\n", ref_srcAlloc);
    fprintf(stderr, "Main::orig_test read numWords=%d burstLen=%d iterCnt=%d\n", numWords, burstLen, iterCnt);
    portalTimerStart(0);
    device->startRead(ref_srcAlloc, numWords * 4, burstLen * 4, iterCnt);
    sem_wait(&test_sem);
    if (mismatchCount) {
        fprintf(stderr, "Main::first test failed to match %d.\n", mismatchCount);
        test_result++;     // failed
    }
    platformStatistics();

    /* Test 2: check that mismatch is detected */
    srcBuffer[0] = -1;
    srcBuffer[numWords/2] = -1;
    srcBuffer[numWords-1] = -1;
    portalCacheFlush(srcAlloc, srcBuffer, alloc_sz, 1);

    fprintf(stderr, "Starting second read, mismatches expected\n");
    mismatchCount = 0;
    device->startRead(ref_srcAlloc, numWords * 4, burstLen * 4, iterCnt);
    sem_wait(&test_sem);
    if (mismatchCount != 3/*number of errors introduced above*/ * iterCnt) {
        fprintf(stderr, "Main::second test failed to match mismatchCount=%d (expected %d) iterCnt=%d numWords=%d.\n",
            mismatchCount, 3*iterCnt,
            iterCnt, numWords);
        test_result++;     // failed
    }
#if 0
    MonkitFile pmf("perf.monkit");
    pmf.setHwCycles(cycles)
        .setReadBwUtil(read_util)
        .writeFile();
#endif
    return test_result;
}
Exemple #10
0
/*
 * Initializes the game, if there are no problems returns GAME_ERROR_NONE.
 */
int gameInit(StcGame *game) {
    int errorCode;

    errorCode = platformInit(game);
    if (errorCode == GAME_ERROR_NONE) {
        startGame(game);
        return GAME_ERROR_NONE;
    }
    return errorCode;
};
Exemple #11
0
void commonInit(void)
{
	platformInit();
	timerInit();
	GPIOInit();
	USB_UserInit();

  	debug_frmwrk_init_clk(CLKFREQ);
	lpc_printf("M4 start\n");
}
Exemple #12
0
bool OWindow::init()
{
    if (!platformInit()) {
        OErrLog("Platform initialization failed !");
        return false;
    }

    ODirector::director()->setFrameSize(m_Width, m_Height);
    ODirector::director()->loadGame();

    return true;
}
Exemple #13
0
Gradient::Gradient(const FloatPoint& p0, float r0, const FloatPoint& p1, float r1)
    : m_radial(true)
    , m_p0(p0)
    , m_p1(p1)
    , m_r0(r0)
    , m_r1(r1)
    , m_stopsSorted(false)
    , m_lastStop(0)
    , m_spreadMethod(SpreadMethodPad)
{
    platformInit();
}
Exemple #14
0
Font::Font(const FontPlatformData& platformData, bool isCustomFont, bool isLoading, bool isTextOrientationFallback)
    : Font(platformData, std::unique_ptr<SVGData>(), isCustomFont, isLoading, isTextOrientationFallback)
{
    platformInit();
    platformGlyphInit();
    platformCharWidthInit();
#if ENABLE(OPENTYPE_VERTICAL)
    if (platformData.orientation() == Vertical && !isTextOrientationFallback) {
        m_verticalData = platformData.verticalData();
        m_hasVerticalGlyphs = m_verticalData.get() && m_verticalData->hasVerticalMetrics();
    }
#endif
}
Exemple #15
0
RenderThemeGtk::RenderThemeGtk()
    : m_panelColor(Color::white)
    , m_sliderColor(Color::white)
    , m_sliderThumbColor(Color::white)
    , m_mediaIconSize(16)
    , m_mediaSliderHeight(14)
{
    platformInit();
#if ENABLE(VIDEO)
    initMediaColors();
    initMediaButtons();
#endif
}
Exemple #16
0
Gradient::Gradient(const FloatPoint& p0, const FloatPoint& p1)
    : m_radial(false)
    , m_p0(p0)
    , m_p1(p1)
    , m_r0(0)
    , m_r1(0)
    , m_aspectRatio(1)
    , m_stopsSorted(false)
    , m_lastStop(0)
    , m_spreadMethod(SpreadMethodPad)
{
    platformInit();
}
Exemple #17
0
void QDirectFbScreenEGL::initializeEGL()
{
    m_eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    if (m_eglDisplay == EGL_NO_DISPLAY)
        return;

    platformInit();

    EGLint major, minor;
    eglBindAPI(EGL_OPENGL_ES_API);
    eglInitialize(m_eglDisplay, &major, &minor);
    return;
}
Exemple #18
0
Gradient::Gradient(const FloatPoint& p0, float r0, const FloatPoint& p1, float r1, float aspectRatio)
    : m_radial(true)
    , m_p0(p0)
    , m_p1(p1)
    , m_r0(r0)
    , m_r1(r1)
    , m_aspectRatio(aspectRatio)
    , m_stopsSorted(false)
    , m_spreadMethod(SpreadMethodPad)
    , m_cachedHash(0)
{
    platformInit();
}
Exemple #19
0
void pixyInit(uint32_t slaveRomStart, const unsigned char slaveImage[], uint32_t imageSize)
{
	platformInit();

	// button, SPI_SSEL
	LPC_GPIO_PORT->MASK[5] = 0;
	LPC_GPIO_PORT->PIN[5] = 0x20; // negate SPI_SS
	LPC_GPIO_PORT->DIR[5] = 0x20; // SPI_SS - output

	// deal with P4_1, GPIO2[1]
	LPC_GPIO_PORT->MASK[2] = 0;
	LPC_GPIO_PORT->DIR[2] = 0;

	// set timer so we count clock cycles
	LPC_TIMER1->IR = 0;
 	LPC_TIMER1->TCR = 1;
	LPC_TIMER1->PR = 0;

	// microsecond timer
	LPC_TIMER2->IR = 0;
 	LPC_TIMER2->TCR = 1;
	LPC_TIMER2->PR = CLKFREQ_US-1;

  	debug_frmwrk_init_clk(CLKFREQ);

	USB_UserInit();

	lpc_printf("M4 start\n");

	IPC_haltSlave();

	ADCInit();
   	SCTInit();
	CameraInit();

	// start slave
	IPC_downloadSlaveImage(slaveRomStart, slaveImage, imageSize);
	IPC_startSlave();

	// initialize chirp objects
	g_chirpUsb = new ChirpUsb();
  	g_chirpM0 = new ChirpM0();

	// initialize devices/modules
	pwr_init();
	spi_init();
	cam_init();
	rcs_init();
	led_init();
	//cc_init();
}
Exemple #20
0
JNIEXPORT void Java_com_studio_artaban_kaleidoscope_EngLibrary_init(JNIEnv* env, jobject obj, jobject activity,
        jint millis, jfloat accelRange, jfloat xDpi, jfloat yDpi) {

    std::string className(JAVA_PROJECT_NAME);
    className.append(LIBENG_ACTIVITY_CLASS);

    activityClass = static_cast<jclass>(env->NewGlobalRef(env->FindClass(className.c_str())));
    if (!activityClass)
        __android_log_print(ANDROID_LOG_ERROR, "JNI", "Failed to find activity class: %s", className.c_str());

    activityObject = env->NewGlobalRef(activity);
    if (!activityObject)
        __android_log_print(ANDROID_LOG_ERROR, "JNI", "Failed to get activity object");

#ifdef LIBENG_ENABLE_SOCIAL
    className = JAVA_PROJECT_NAME;
    className.append(LIBENG_FACEBOOK_CLASS);
    facebookClass = static_cast<jclass>(env->NewGlobalRef(env->FindClass(className.c_str())));
    if (!facebookClass)
        __android_log_print(ANDROID_LOG_ERROR, "JNI", "Failed to find facebook class");

    className = JAVA_PROJECT_NAME;
    className.append(LIBENG_TWITTER_CLASS);
    twitterClass = static_cast<jclass>(env->NewGlobalRef(env->FindClass(className.c_str())));
    if (!twitterClass)
        __android_log_print(ANDROID_LOG_ERROR, "JNI", "Failed to find twitter class");

    className = JAVA_PROJECT_NAME;
    className.append(LIBENG_GOOGLE_CLASS);
    googleClass = static_cast<jclass>(env->NewGlobalRef(env->FindClass(className.c_str())));
    if (!googleClass)
        __android_log_print(ANDROID_LOG_ERROR, "JNI", "Failed to find google class");
#endif

    PlatformData platformData;
    platformData.jvm = javaVM;
    platformData.jpn = JAVA_PROJECT_NAME;
    platformData.cls = activityClass;
    platformData.obj = activityObject;
#ifdef LIBENG_ENABLE_SOCIAL
    platformData.facebook = facebookClass;
    platformData.twitter = twitterClass;
    platformData.google = googleClass;
#endif
    platformData.accelRange = static_cast<float>(accelRange);
    platformData.xDpi = static_cast<float>(xDpi);
    platformData.yDpi = static_cast<float>(yDpi);

    init(platformData);
    platformInit(static_cast<long>(millis), &platformData);
}
Exemple #21
0
int main(int argc, const char **argv)
{
    unsigned int srcGen = 0;
    NandSimRequestProxy *device = 0;
    NandSimIndication *deviceIndication = 0;

    fprintf(stderr, "Main::%s %s\n", __DATE__, __TIME__);

    device = new NandSimRequestProxy(IfcNames_NandSimRequest);
    deviceIndication = new NandSimIndication(IfcNames_NandSimIndication);
    DmaManager *dma = platformInit();

    fprintf(stderr, "Main::allocating memory...\n");

    srcAlloc = portalAlloc(numBytes, 0);
    srcBuffer = (unsigned int *)portalMmap(srcAlloc, numBytes);
    fprintf(stderr, "fd=%d, srcBuffer=%p\n", srcAlloc, srcBuffer);

    for (int i = 0; i < numBytes/sizeof(srcBuffer[0]); i++)
        srcBuffer[i] = srcGen++;

    portalCacheFlush(srcAlloc, srcBuffer, numBytes, 1);
    fprintf(stderr, "Main::flush and invalidate complete\n");
    sleep(1);

    unsigned int ref_srcAlloc = dma->reference(srcAlloc);

    nandAlloc = portalAlloc(nandBytes, 0);
    int ref_nandAlloc = dma->reference(nandAlloc);
    fprintf(stderr, "NAND alloc fd=%d ref=%d\n", nandAlloc, ref_nandAlloc);
    device->configureNand(ref_nandAlloc, nandBytes);
    deviceIndication->wait();

    fprintf(stderr, "Main::starting write ref=%d, len=%08zx\n", ref_srcAlloc, numBytes);
    device->startWrite(ref_srcAlloc, 0, 0, numBytes, 16);
    deviceIndication->wait();

    fprintf(stderr, "Main::starting read %08zx\n", numBytes);
    device->startRead(ref_srcAlloc, 0, 0, numBytes, 16);
    deviceIndication->wait();

    fprintf(stderr, "Main::starting erase %08zx\n", numBytes);
    device->startErase(0, numBytes);
    deviceIndication->wait();

    fprintf(stderr, "Main::starting read %08zx\n", numBytes);
    device->startRead(ref_srcAlloc, 0, 0, numBytes, 16);
    deviceIndication->wait();
    return 0;
}
Exemple #22
0
SimpleFontData::SimpleFontData(const FontPlatformData& platformData, bool isCustomFont, bool isLoading)
    : m_maxCharWidth(-1)
    , m_avgCharWidth(-1)
    , m_orientation(platformData.orientation())
    , m_platformData(platformData)
    , m_treatAsFixedPitch(false)
    , m_isCustomFont(isCustomFont)
    , m_isLoading(isLoading)
    , m_isBrokenIdeographFont(false)
{
    platformInit();
    platformGlyphInit();
    platformCharWidthInit();
}
Exemple #23
0
FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fontDescription,
                                                       const AtomicString& passedFamilyName,
                                                       bool checkingAlternateName)
{
#if PLATFORM(IOS)
    FontLocker fontLocker;
#endif
    
#if OS(WINDOWS) && ENABLE(OPENTYPE_VERTICAL)
    // Leading "@" in the font name enables Windows vertical flow flag for the font.
    // Because we do vertical flow by ourselves, we don't want to use the Windows feature.
    // IE disregards "@" regardless of the orientatoin, so we follow the behavior.
    const AtomicString& familyName = (passedFamilyName.isEmpty() || passedFamilyName[0] != '@') ?
        passedFamilyName : AtomicString(passedFamilyName.impl()->substring(1));
#else
    const AtomicString& familyName = passedFamilyName;
#endif

    static bool initialized;
    if (!initialized) {
        platformInit();
        initialized = true;
    }

    FontPlatformDataCacheKey key(familyName, fontDescription);

    auto addResult = fontPlatformDataCache().add(key, nullptr);
    FontPlatformDataCache::iterator it = addResult.iterator;
    if (addResult.isNewEntry) {
        it->value = createFontPlatformData(fontDescription, familyName);

        if (!it->value && !checkingAlternateName) {
            // We were unable to find a font.  We have a small set of fonts that we alias to other names,
            // e.g., Arial/Helvetica, Courier/Courier New, etc.  Try looking up the font under the aliased name.
            const AtomicString alternateName = alternateFamilyName(familyName);
            if (!alternateName.isNull()) {
                FontPlatformData* fontPlatformDataForAlternateName = getCachedFontPlatformData(fontDescription, alternateName, true);
                // Lookup the key in the hash table again as the previous iterator may have
                // been invalidated by the recursive call to getCachedFontPlatformData().
                it = fontPlatformDataCache().find(key);
                ASSERT(it != fontPlatformDataCache().end());
                if (fontPlatformDataForAlternateName)
                    it->value = std::make_unique<FontPlatformData>(*fontPlatformDataForAlternateName);
            }
        }
    }

    return it->value.get();
}
SimpleFontData::SimpleFontData(const FontPlatformData& platformData, bool isCustomFont, bool isLoading, bool isTextOrientationFallback)
    : m_maxCharWidth(-1)
    , m_avgCharWidth(-1)
    , m_platformData(platformData)
    , m_treatAsFixedPitch(false)
    , m_isCustomFont(isCustomFont)
    , m_isLoading(isLoading)
    , m_isTextOrientationFallback(isTextOrientationFallback)
    , m_isBrokenIdeographFallback(false)
    , m_hasVerticalGlyphs(false)
{
    platformInit();
    platformGlyphInit();
    platformCharWidthInit();
}
Exemple #25
0
int main(int argc, const char **argv)
{
  DmaManager *dma = platformInit();
  Ddr3TestRequestProxy *testRequest = new Ddr3TestRequestProxy(IfcNames_Ddr3TestRequestS2H);
  Ddr3TestIndication testIndication(IfcNames_Ddr3TestIndicationH2S);

  if(sem_init(&write_sem, 1, 0)){
    fprintf(stderr, "failed to init write_sem\n");
    return -1;
  }
  if(sem_init(&read_sem, 1, 0)){
    fprintf(stderr, "failed to init read_sem\n");
    return -1;
  }
  int srcAlloc = portalAlloc(alloc_sz, 0);
  int dstAlloc = portalAlloc(alloc_sz, 0);
  int *srcBuffer = (int *)portalMmap(srcAlloc, alloc_sz);
  int *dstBuffer = (int *)portalMmap(dstAlloc, alloc_sz);
  for (int i = 0; i < 1024/4; i++) {
      srcBuffer[i] = i;
      fprintf(stderr, "src dram[%04x]=%08x\n", i*4, srcBuffer[i]);
  }
  int ref_srcAlloc = dma->reference(srcAlloc);
  int ref_dstAlloc = dma->reference(dstAlloc);

  if (1) {
      int transferLen = 1024;
      testRequest->startWriteDram(ref_srcAlloc, transferLen);
      fprintf(stderr, "Started writing dram\n");
      for (int i = 0; i < transferLen; i += DataBusWidth)
	  sem_wait(&write_sem);

      testRequest->startReadDram(ref_dstAlloc, transferLen);
      sem_wait(&read_sem);
  }
  for (int i = 0; i < 1024/4; i++) {
      fprintf(stderr, "dst dram[%04x]=%08x\n", i*4, dstBuffer[i]);
  }
  int mismatches = 0;
  for (int i = 0; i < 1024/4; i++) {
      if (i != dstBuffer[i]) {
	  mismatches++;
	  fprintf(stderr, "mismatch dram[%04x]=%08x expected %08x\n", i*4, dstBuffer[i], i);
      }
  }
  fprintf(stderr, "%d mismatches\n", mismatches);
  return mismatches ? 1 : 0;
}
Exemple #26
0
static void prvSetupHardware( void )
{
extern void Hitex_CGU_Init( void );

	/* Setup system (clock, PLL and Flash configuration) */
	platformInit();

	/* Wind the clock speed up in steps to its maximum. */
	Hitex_CGU_Init();
	
	/* Ensure all priority bits are assigned as preemption priority bits. */
	NVIC_SetPriorityGrouping( 0 );
	
	/* Setup the LED outputs. */
	vParTestInitialise();
}
Exemple #27
0
SimpleFontData::SimpleFontData(const FontPlatformData& platformData, PassRefPtr<CustomFontData> customData, bool isTextOrientationFallback)
    : m_maxCharWidth(-1)
    , m_avgCharWidth(-1)
    , m_platformData(platformData)
    , m_isTextOrientationFallback(isTextOrientationFallback)
    , m_verticalData(nullptr)
    , m_hasVerticalGlyphs(false)
    , m_customFontData(customData)
{
    platformInit();
    platformGlyphInit();
    if (platformData.isVerticalAnyUpright() && !isTextOrientationFallback) {
        m_verticalData = platformData.verticalData();
        m_hasVerticalGlyphs = m_verticalData.get() && m_verticalData->hasVerticalMetrics();
    }
}
Exemple #28
0
Fichier : game.c Projet : ex/blocks
/*
 * Initialize the game. The error code (if any) is saved in [game->errorCode].
 */
void gameInit(StcGame *game) {
    /* Allocate space for our game internal data */
    game->data = (StcGamePrivate *) malloc(sizeof(StcGamePrivate));
    if (game->data == NULL) {
        game->errorCode = ERROR_NO_MEMORY;
    }
    else {
        /* Initialize platform */
        game->errorCode = platformInit(game);

        if (game->errorCode == ERROR_NONE) {
            /* If platform was correctly initialized, start the game */
            startGame(game);
        }
    }
}
Exemple #29
0
int main()
{
    systemInit();
    platformInit();

    DEBUG_PRINT ( "init successfully\n" );

    while ( 1 )
    {

        SBN1_USART_Handle_Reveived();
        SBN1_Loop();

    }

    return 0;
}
Exemple #30
0
FontData::FontData(const FontPlatformData& f)
    : m_font(f)
    , m_treatAsFixedPitch(false)
    , m_smallCapsFontData(0)
{    
    platformInit();
    
    // Nasty hack to determine if we should round or ceil space widths.
    // If the font is monospace or fake monospace we ceil to ensure that 
    // every character and the space are the same width.  Otherwise we round.
    m_spaceGlyph = GlyphPageTreeNode::getRootChild(this, 0)->page()->glyphDataForCharacter(' ').glyph;
    float width = widthForGlyph(m_spaceGlyph);
    m_spaceWidth = width;
    determinePitch();
    m_adjustedSpaceWidth = m_treatAsFixedPitch ? ceilf(width) : roundf(width);
    m_missingGlyphData.fontData = this;
    m_missingGlyphData.glyph = 0;
}