Beispiel #1
0
static __init void resource_buzzer_pwm_init(void)
{
	if(register_resource(&res_buzzer_pwm))
		LOG("Register resource %s:'%s.%d'", res_buzzer_pwm.mach, res_buzzer_pwm.name, res_buzzer_pwm.id);
	else
		LOG("Failed to register resource %s:'%s.%d'", res_buzzer_pwm.mach, res_buzzer_pwm.name, res_buzzer_pwm.id);
}
Beispiel #2
0
static __init void resource_console_init(void)
{
	if(register_resource(&res_console))
		LOG("Register resource %s:'%s.%d'", res_console.mach, res_console.name, res_console.id);
	else
		LOG("Failed to register resource %s:'%s.%d'", res_console.mach, res_console.name, res_console.id);
}
constructor_ppb_video_decoder(void)
{
    avcodec_register_all();

    register_interface(PPB_VIDEODECODER_DEV_INTERFACE_0_16, &ppb_video_decoder_dev_interface_0_16);
    register_resource(PP_RESOURCE_VIDEO_DECODER, ppb_video_decoder_destroy_priv);
}
Beispiel #4
0
static __init void resource_led_pwm_bl_init(void)
{
	int i;

	for(i = 0; i < ARRAY_SIZE(res_led_pwm_bls); i++)
		register_resource(&res_led_pwm_bls[i]);
}
constructor_ppb_host_resolver(void)
{
    register_interface(PPB_HOSTRESOLVER_PRIVATE_INTERFACE_0_1,
                       &ppb_host_resolver_private_interface_0_1);
    register_interface(PPB_HOSTRESOLVER_INTERFACE_1_0, &ppb_host_resolver_interface_1_0);
    register_resource(PP_RESOURCE_HOST_RESOLVER, ppb_host_resolver_destroy);
}
 WRATHAttributePacker(const ResourceKey &pname,
                      iterator begin, iterator end):
   m_resource_name(pname),
   m_attribute_names(begin, end)
 {
   register_resource();
 }
Beispiel #7
0
static __init void resource_pl110_fb_init(void)
{
	int i;

	for(i = 0; i < ARRAY_SIZE(res_fbs); i++)
		register_resource(&res_fbs[i]);
}
Beispiel #8
0
static __init void resource_pmic_init(void)
{
	if(register_resource(&res_axp228))
		LOG("Register resource '%s:%s.%d'", res_axp228.mach, res_axp228.name, res_axp228.id);
	else
		LOG("Failed to register resource '%s:%s.%d'", res_axp228.mach, res_axp228.name, res_axp228.id);
}
 /*!\fn WRATHAttributePacker(const ResourceKey &pname, const std::vector<std::string>&)
   Ctor. Specifies the resource name of the attribute packer
   and the names of each attribute as an STL range.
   The number of attributes is then std::distance(begin,end)
   and the attribute of index I has value *(begin+I).
   \tparam iterator to string type
   \param pname resource name to identify the WRATHAttributePacker
   \param pattribute_names names of the attributes, value at index 0 
                           will be for attribute #0 in GL
  */
 WRATHAttributePacker(const ResourceKey &pname,
                      const std::vector<std::string> &pattribute_names):
   m_resource_name(pname),
   m_attribute_names(pattribute_names)
 {
   register_resource();
 }
Beispiel #10
0
static __init void resource_uart_init(void)
{
	int i;

	for(i = 0; i < ARRAY_SIZE(res_uarts); i++)
		register_resource(&res_uarts[i]);
}
Beispiel #11
0
 bool register_resource(const std::string& resource,
         http_resource<T>* res, bool family = false
 )
 {
     details::http_resource_mirror hrm(res);
     return register_resource(resource, hrm, family);
 }
Beispiel #12
0
static __init void resource_fb_init(void)
{
	if(register_resource(&res_fb))
		LOG("Register resource %s:'%s.%d'", res_fb.mach, res_fb.name, res_fb.id);
	else
		LOG("Failed to register resource %s:'%s.%d'", res_fb.mach, res_fb.name, res_fb.id);
}
Beispiel #13
0
static __init void resource_i2c_gpio_init(void)
{
	int i;

	for(i = 0; i < ARRAY_SIZE(res_i2c_gpios); i++)
		register_resource(&res_i2c_gpios[i]);
}
Beispiel #14
0
RTupDescStack rtds_initStack(lua_State *L) {
    RTupDescStack sp;
    L = pllua_getmaster(L);
    MTOLUA(L);
    sp = (RTupDescStack) palloc(sizeof(RTupDescStackType));
    MTOPG;
    sp->ref_count = 0;
    sp->L = L;
    sp->top = NULL;
    sp->resptr = register_resource(sp, force_free);
    return sp;
}
Beispiel #15
0
static __init void resource_uart_init(void)
{
	int i;

	for(i = 0; i < ARRAY_SIZE(res_uarts); i++)
	{
		if(register_resource(&res_uarts[i]))
			LOG("Register resource %s:'%s.%d'", res_uarts[i].mach, res_uarts[i].name, res_uarts[i].id);
		else
			LOG("Failed to register resource %s:'%s.%d'", res_uarts[i].mach, res_uarts[i].name, res_uarts[i].id);
	}
}
Beispiel #16
0
static __init void dev_serial_init(void)
{
	u32_t i;

	for(i = 0; i < ARRAY_SIZE(serial_devs); i++)
	{
		if(!register_resource(&serial_devs[i]))
		{
			LOG_E("failed to register resource '%s'", serial_devs[i].name);
		}
	}
}
Beispiel #17
0
PROCESS_THREAD(test, ev, data)
{

	static struct etimer et;

	PROCESS_BEGIN();
		myaddr = init_l2addr_154_char("45:67");

		l2 = startL2_154( myaddr, CHANNEL, PANID); 
		ca = initCasan(l2, MTU, slaveid);

		r1 = initResource (R1_name, R1_title, R1_rt) ;
		setHandlerResource(r1, COAP_CODE_GET, process_temp );
		register_resource(ca, r1);

		r2 = initResource (R2_name, R2_title, R2_rt) ;
		setHandlerResource(r2, COAP_CODE_GET, process_temp );
		register_resource(ca, r2);

		while(1) {    

			if (n % NTAB (resname) == 0)
	    		print_resources (ca) ;
	    	test_resource (ca, l2, resname [n++ % NTAB (resname)]) ;
			
	    	printf("\n");
	    	printf("*************************************************************************");
	    	printf("\n");

	        etimer_set(&et,5*CLOCK_SECOND); 
        	PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et));
	    }



   	PROCESS_END();
}
constructor_ppb_input_event(void)
{
    register_interface(PPB_IME_INPUT_EVENT_DEV_INTERFACE_0_2,
                       &ppb_ime_input_event_dev_interface_0_2);
    register_interface(PPB_INPUT_EVENT_INTERFACE_1_0, &ppb_input_event_interface_1_0);
    register_interface(PPB_MOUSE_INPUT_EVENT_INTERFACE_1_1, &ppb_mouse_input_event_interface_1_1);
    register_interface(PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0, &ppb_wheel_input_event_interface_1_0);
    register_interface(PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0,
                       &ppb_keyboard_input_event_interface_1_0);
    register_interface(PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_2,
                       &ppb_keyboard_input_event_interface_1_2);
    register_interface(PPB_TOUCH_INPUT_EVENT_INTERFACE_1_0, &ppb_touch_input_event_interface_1_0);
    register_interface(PPB_IME_INPUT_EVENT_INTERFACE_1_0, &ppb_ime_input_event_interface_1_0);
    register_resource(PP_RESOURCE_INPUT_EVENT, ppb_input_event_destroy);
}
Beispiel #19
0
static __init void resource_mouse_init(void)
{
    register_resource(&res_mouse);
}
constructor_ppb_printing(void)
{
    register_interface(PPB_PRINTING_DEV_INTERFACE_0_7, &ppb_printing_dev_interface_0_7);
    register_resource(PP_RESOURCE_PRINTING, ppb_printing_destroy);
}
Beispiel #21
0
static __init void resource_rtc_init(void)
{
	register_resource(&res_rtc);
}
constructor_ppb_image_data(void)
{
    register_interface(PPB_IMAGEDATA_INTERFACE_1_0, &ppb_image_data_interface_1_0);
    register_resource(PP_RESOURCE_IMAGE_DATA, ppb_image_data_destroy);
}
constructor_ppb_url_request_info(void)
{
    register_interface(PPB_URLREQUESTINFO_INTERFACE_1_0, &ppb_url_request_info_interface_1_0);
    register_resource(PP_RESOURCE_URL_REQUEST_INFO, ppb_url_request_info_destroy);
}
static __init void dev_console_init(void)
{
	if(!register_resource(&led_console))
		LOG_E("failed to register resource '%s'", led_console.name);
}
constructor_ppb_url_loader(void)
{
    register_interface(PPB_URLLOADER_INTERFACE_1_0, &ppb_url_loader_interface_1_0);
    register_interface(PPB_URLLOADERTRUSTED_INTERFACE_0_3, &ppb_url_loader_trusted_interface_0_3);
    register_resource(PP_RESOURCE_URL_LOADER, ppb_url_loader_destroy);
}
Beispiel #26
0
static __init void dev_heartbeat_init(void)
{
	if(!register_resource(&led_heartbeat))
		LOG_E("failed to register resource '%s'", led_heartbeat.name);
}
constructor_ppb_flash_message_loop(void)
{
    register_interface(PPB_FLASH_MESSAGELOOP_INTERFACE_0_1, &ppb_flash_message_loop_interface_0_1);
    register_resource(PP_RESOURCE_FLASH_MESSAGE_LOOP, ppb_flash_message_loop_destroy);
}
Beispiel #28
0
	shooting(main_window *w):
		window(*w),
		config(keyconfig::get_instance()),
		holder(std::make_shared<resource_holder>()),
		player_(holder)
	{
		register_resource(holder.get());

		register_object(&dialog);
		dialog.set_button_text(0, L"はい");
		dialog.set_button_handler(0, [this](){
			this->dialog.hide();
			on_hide();
			on_show();
		});
		dialog.set_button_text(1, L"いいえ");
		dialog.set_button_handler(1, [this](){
			this->dialog.hide();
			this->window.select_scene(main_window::scene::title);
		});
		dialog.set_size(paint::size(300, 200));
		dialog.set_position(paint::point(250, 200));

		add_keyboard_handler([this](unsigned keycode, bool push){
			config->set_keyboard_state(keycode, push);
		}, keycode_range(0, 255));

		add_timer_handler([this](...){
			if(pause)
				return;

			auto state = config->get_state();
			vector v;
			const float velocity = 7.f;

			if(state.up){
				v[1][0] -= velocity;
			}
			if(state.down){
				v[1][0] += velocity;
			}
			if(state.left){
				v[0][0] -= velocity;
			}
			if(state.right){
				v[0][0] += velocity;
			}
			player_.set_vector(v);

			auto now = std::chrono::system_clock::now();

			if(state.b && now - bullet_time >= std::chrono::milliseconds(192)){
				auto it = std::find(bullets.begin(), bullets.end(), false);
				if(it != bullets.end()){
					float r = it->get_radius();
					it->set_position(player_.get_center());
					it->set_vector(vector(0, -10));
					it->set_active();

					auto trans = transform::scale(1.f, 1.01f);
					if(state.a){
						trans = transform::rotation(to_rad(-0.5)) * trans;
					}
					if(state.c){
						trans = transform::rotation(to_rad(0.5)) * trans;
					}
					it->set_transform(trans);
				}

				bullet_time = now;
			}

			if(now - enemy_time >= enemy_duration){
				enemy_duration = std::chrono::milliseconds(this->rand() % 750 + 250);
				enemy_time = now;
				enemies.push_back(new enemy1(holder));
				enemies.back()->set_position(paint::point(static_cast<float>(this->rand() % 800), -50));
			}

			move();

			this->window.repaint();
		}, timer_id);
	}
constructor_ppb_device_ref(void)
{
    register_interface(PPB_DEVICEREF_DEV_INTERFACE_0_1, &ppb_device_ref_dev_interface_0_1);
    register_resource(PP_RESOURCE_DEVICE_REF, ppb_device_ref_destroy);
}
constructor_ppb_url_response_info(void)
{
    register_interface(PPB_URLRESPONSEINFO_INTERFACE_1_0, &ppb_url_response_info_interface_1_0);
    register_resource(PP_RESOURCE_URL_RESPONSE_INFO, ppb_url_response_info_destroy);
}