Add control.dmesg
This commit is contained in:
		@@ -22,4 +22,9 @@ int allocateNotifyEvent() {
 | 
			
		||||
    return pxt::allocateNotifyEvent();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** Write data to DMESG debugging buffer. */
 | 
			
		||||
//%
 | 
			
		||||
void dmesg(String s) {
 | 
			
		||||
    DMESG("# %s", s->data);
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
namespace core {
 | 
			
		||||
namespace control {
 | 
			
		||||
    let nextComponentId = 20000;
 | 
			
		||||
 | 
			
		||||
    export class Component {
 | 
			
		||||
 
 | 
			
		||||
@@ -116,7 +116,7 @@ namespace input.internal {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    export class Sensor extends core.Component {
 | 
			
		||||
    export class Sensor extends control.Component {
 | 
			
		||||
        protected port: number
 | 
			
		||||
 | 
			
		||||
        constructor() {
 | 
			
		||||
@@ -407,7 +407,7 @@ namespace input.internal {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
namespace input {
 | 
			
		||||
    export class ButtonWrapper extends core.Component {
 | 
			
		||||
    export class ButtonWrapper extends control.Component {
 | 
			
		||||
        private downTime: number;
 | 
			
		||||
        private _isPressed: boolean;
 | 
			
		||||
        private _wasPressed: boolean;
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
 | 
			
		||||
namespace pxt {
 | 
			
		||||
void dmesg(const char *fmt, ...);
 | 
			
		||||
#define DMESG dmesg
 | 
			
		||||
#define DMESG pxt::dmesg
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								libs/core/shims.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								libs/core/shims.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -51,6 +51,10 @@ declare namespace control {
 | 
			
		||||
     */
 | 
			
		||||
    //% help=control/allocate-notify-event shim=control::allocateNotifyEvent
 | 
			
		||||
    function allocateNotifyEvent(): int32;
 | 
			
		||||
 | 
			
		||||
    /** Write data to DMESG debugging buffer. */
 | 
			
		||||
    //% shim=control::dmesg
 | 
			
		||||
    function dmesg(s: string): void;
 | 
			
		||||
}
 | 
			
		||||
declare namespace input {
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user